//
// Rescue
//

#include "stagesetup.h"

// Characters
#define CHR_ALIEN              0x38
#define CHR_DOORMAN            0x39
#define CHR_LABTECH_RECORDS    0x3a
#define CHR_LABTECH_LIGHTS     0x3b
#define CHR_LABTECH_DOORS1     0x3c
#define CHR_LABTECH_SHOWERS    0x3d
#define CHR_LABTECH_HARRYSMATE 0x3e
#define CHR_LABTECH_KEYCARDGUY 0x3f
#define CHR_BIOTECH1           0x40
#define CHR_BIOTECH2           0x41
#define CHR_LABTECH_DOORS2     0x42
#define CHR_MECHANIC           0x43
#define CHR_JONATHAN           0x48
#define CHR_INTRO_DEAD_GUARD   0x49

// Objects
#define OBJ_LABCOAT1         0x00
#define OBJ_DOOR_TERMINAL    0x02
#define OBJ_DATAUPLINK_BOND  0x05
#define OBJ_KEYCARD          0x06
#define OBJ_CRATE            0x17
#define OBJ_WALL             0x18
#define OBJ_AUTOGUN          0x19
#define OBJ_CHAMBER1         0x1a
#define OBJ_CHAMBER2         0x1b
#define OBJ_CHAMBER3         0x1c
#define OBJ_CHAMBER4         0x1d
#define OBJ_CHAMBER5         0x1e
#define OBJ_CHAMBER6         0x1f
#define OBJ_CHAMBER7         0x20
#define OBJ_CHAMBER8         0x21
#define OBJ_CHAMBER1_SWITCH  0x22
#define OBJ_CHAMBER2_SWITCH  0x23
#define OBJ_CHAMBER3_SWITCH  0x24
#define OBJ_CHAMBER4_SWITCH  0x25
#define OBJ_CHAMBER5_SWITCH  0x26
#define OBJ_CHAMBER6_SWITCH  0x27
#define OBJ_CHAMBER7_SWITCH  0x28
#define OBJ_CHAMBER8_SWITCH  0x29
#define OBJ_DATAUPLINK_COOP  0x3a
#define OBJ_LABCOAT2         0x3e
#define OBJ_LABCOAT3         0x3f
#define OBJ_LABCOAT4         0x40
#define OBJ_LABCOAT5         0x41
#define OBJ_FALCON2SILENCED1 0x4c
#define OBJ_FALCON2SILENCED2 0x4d
#define OBJ_PHOENIX          0x4e

// Stage flags
#define STAGEFLAG_CHAMBER4_RAISED             0x00000001
#define STAGEFLAG_CHAMBER5_RAISED             0x00000002
#define STAGEFLAG_CHAMBER6_RAISED             0x00000004
#define STAGEFLAG_CHAMBER7_RAISED             0x00000008
#define STAGEFLAG_CHAMBER8_RAISED             0x00000010
#define STAGEFLAG_LOOKING_AT_CHAMBER          0x00000020
#define STAGEFLAG_ONE_KEYCARD_GUARD_REMAINING 0x00000040
#define STAGEFLAG_UPLINK_TERMINAL_DESTROYED   0x00000080
#define STAGEFLAG_USED_DISGUISE               0x00000100
#define STAGEFLAG_RECORDS_DESTROYED           0x00000200
#define STAGEFLAG_DOOR_VIRUS_DOWNLOADED       0x00000400
#define STAGEFLAG_LIGHT_VIRUS_DONE            0x00000800
#define STAGEFLAG_AUTOGUN_VIRUS_DONE          0x00001000
#define STAGEFLAG_ENTERED_LAB                 0x00002000
#define STAGEFLAG_DISGUISE_UNCOVERED          0x00010000
#define STAGEFLAG_LABTECH_DEAD                0x00020000
#define STAGEFLAG_DOORMAN_REJECTED            0x00040000
#define STAGEFLAG_DOORMAN_DEAD                0x00080000
#define STAGEFLAG_KEYCARDGUY_ANGRY            0x00100000
#define STAGEFLAG_ENTERED_ELVIS_AREA          0x00200000
#define STAGEFLAG_RESCUED_ELVIS               0x00400000
#define STAGEFLAG_ELVIS_DEAD                  0x00800000
#define STAGEFLAG_XRAY_DONE                   0x01000000
#define STAGEFLAG_CHAMBER_SWITCH_DESTROYED    0x02000000
#define STAGEFLAG_CRATE_DESTROYED             0x08000000
#define STAGEFLAG_AUTOGUN_ACTIVATED           0x10000000
#define STAGEFLAG_CHAMBER1_RAISED             0x20000000
#define STAGEFLAG_CHAMBER2_RAISED             0x40000000
#define STAGEFLAG_CHAMBER3_RAISED             0x80000000

// AI Lists
#define AILIST_LABTECH_SA_PA          0x0410
#define AILIST_LABTECH_AGENT          0x0411
#define AILIST_INIT_LABTECH           0x0412
#define AILIST_MECHANIC               0x0413
#define AILIST_INIT_MECHANIC          0x0414
#define AILIST_WAREHOUSE_SPAWNER      0x0415
#define AILIST_BECOME_UNAWARE         0x0416
#define AILIST_WAREHOUSE_CLONE        0x0417
#define AILIST_DOORMAN                0x0418
#define AILIST_INIT_DOORMAN           0x0419
#define AILIST_LABTECH_HARRYSMATE     0x041a
#define AILIST_LABTECH_KEYCARDGUY     0x041b
#define AILIST_LABTECH_LIGHTS         0x041f
#define AILIST_LABTECH_DOORS          0x0420
#define AILIST_INIT_LABTECH_DOORS     0x0421
#define AILIST_LABTECH_RECORDS        0x0422
#define AILIST_INIT_LABTECH_RECORDS   0x0423
#define AILIST_ALIEN                  0x0424
#define AILIST_HIDDENGUY              0x0425
#define AILIST_CHECK_LOOKING_AT_ALIEN 0x0426
#define AILIST_SHOCK_CLONE            0x0427
#define AILIST_OUTRO                  0x0428
#define AILIST_DRAGON_GUARD           0x042c
#define AILIST_SUPERDRAGON_GUARD      0x042d
#define AILIST_BIOTECH_GUARD          0x042e
#define AILIST_BIOTECH_GUARD_ALERTED  0x042f
#define AILIST_BIOTECH2               0x0430
#define AILIST_BIOTECH1               0x0431
#define AILIST_INIT_BIOTECH1          0x0432
#define AILIST_INIT_BIOTECH2          0x0433

enum labelnum {
	LABEL_2D = (VERSION >= VERSION_NTSC_1_0 ? 0x2d : 0x2c),
	LABEL_2E,
	LABEL_2F,
	LABEL_30,
	LABEL_31,
	LABEL_32,
	LABEL_33,
	LABEL_34,
	LABEL_35,
	LABEL_36,
	LABEL_37,
	LABEL_38,
	LABEL_39,
	LABEL_3A,
	LABEL_3B,
	LABEL_3C,
	LABEL_3D,
	LABEL_3E,
	LABEL_3F,
	LABEL_40,
	LABEL_41,
	LABEL_42,
	LABEL_43,
	LABEL_44,
	LABEL_45,
	LABEL_46,
	LABEL_47,
	LABEL_48,
	LABEL_49,
	LABEL_4A,
	LABEL_4B,
	LABEL_4C,
	LABEL_4D,
	LABEL_4E,
	LABEL_4F,
	LABEL_50,
	LABEL_51,
	LABEL_52,
	LABEL_53,
	LABEL_54,
	LABEL_55,
	LABEL_56,
	LABEL_57,
	LABEL_58,
	LABEL_59,
	LABEL_5A,
	LABEL_5B,
	LABEL_5C,
	LABEL_5D,
	LABEL_5E,
	LABEL_5F,
	LABEL_60,
	LABEL_61,
	LABEL_62,
	LABEL_63,
	LABEL_64,
	LABEL_65,
	LABEL_66,
	LABEL_67,
	LABEL_68,
	LABEL_69,
	LABEL_6A,
	LABEL_6B,
	LABEL_6C,
	LABEL_6D,
	LABEL_6E,
	LABEL_6F,
	LABEL_70,
	LABEL_71,
	LABEL_72,
	LABEL_73,
	LABEL_74,
	LABEL_75,
	LABEL_76,
	LABEL_77,
	LABEL_78,
	LABEL_79,
	LABEL_7A,
	LABEL_7B,
	LABEL_7C,
	LABEL_7D,
	LABEL_7E,
	LABEL_7F,
	LABEL_80,
	LABEL_81,
	LABEL_82,
	LABEL_83,
	LABEL_84,
	LABEL_85,
	LABEL_86,
	LABEL_87,
	LABEL_88,
	LABEL_89,
	LABEL_8A,
	LABEL_8B,
	LABEL_8C,
	LABEL_8D,
	LABEL_8E,
	LABEL_8F,
	LABEL_90,
	LABEL_91,
	LABEL_92,
	LABEL_93,
	LABEL_94,
	LABEL_95,
	LABEL_96,
	LABEL_97,
	LABEL_98,
	LABEL_99,
	LABEL_9A,
	LABEL_9B,
	LABEL_9C,
	LABEL_9D,
	LABEL_9E,
	LABEL_9F,
	LABEL_A0,
	LABEL_A1,
	LABEL_A2,
	LABEL_A3,
	LABEL_A4,
	LABEL_A5,
	LABEL_A6,
	LABEL_A7,
	LABEL_A8,
	LABEL_A9,
	LABEL_AA,
	LABEL_AB,
	LABEL_AC,
	LABEL_AD,
	LABEL_AE,
	LABEL_AF,
	LABEL_B0,
	LABEL_B1,
	LABEL_B2,
	LABEL_B3,
	LABEL_B4,
	LABEL_B5,
	LABEL_B6,
	LABEL_B7,
	LABEL_B8,
	LABEL_B9,
	LABEL_BA,
	LABEL_BB,
	LABEL_BC,
	LABEL_BD,
	LABEL_BE,
	LABEL_BF,
	LABEL_C0,
	LABEL_C1,
	LABEL_C2,
	LABEL_C3,
	LABEL_C4,
	LABEL_C5,
	LABEL_C6,
	LABEL_C7,
	LABEL_C8,
	LABEL_C9,
	LABEL_CA,
	LABEL_CB,
	LABEL_CC,
	LABEL_CD,
	LABEL_CE,
	LABEL_CF,
	LABEL_D0,
	LABEL_D1,
	LABEL_D2,
	LABEL_D3,
	LABEL_D4,
	LABEL_D5,
	LABEL_D6,
	LABEL_D7,
	LABEL_D8,
	LABEL_D9,
	LABEL_DA,
	LABEL_DB,
	LABEL_DC,
	LABEL_DD,
	LABEL_DE,
	LABEL_DF,
	LABEL_E0,
	LABEL_E1,
	LABEL_E2,
	LABEL_E3,
	LABEL_E4,
	LABEL_E5,
	LABEL_E6,
	LABEL_E7,
	LABEL_E8,
	LABEL_E9,
	LABEL_EA,
	LABEL_EB,
	LABEL_EC,
	LABEL_ED,
	LABEL_EE,
	LABEL_EF,
	LABEL_F0,
	LABEL_F1,
	LABEL_F2,
	LABEL_F3,
	LABEL_F4,
	LABEL_F5,
	LABEL_F6
};

extern s32 intro[];
extern u32 props[];
extern struct path paths[];
extern struct ailist ailists[];

struct stagesetup setup = {
	NULL,
	NULL,
	NULL,
	intro,
	props,
	paths,
	ailists,
	NULL,
};

u32 props[] = {
	briefing(BRIEFINGTYPE_LOCATION, L_LIP_001)
	briefing(BRIEFINGTYPE_TEXT_PA,  L_LIP_000)
	briefing(BRIEFINGTYPE_TEXT_SA,  L_LIP_002)
	briefing(BRIEFINGTYPE_TEXT_A,   L_LIP_003)

	beginobjective(0, L_LIP_010, (DIFFBIT_PA | DIFFBIT_PD)) // "Destroy computer records"
		complete_flags(STAGEFLAG_RECORDS_DESTROYED)
		fail_flags(STAGEFLAG_UPLINK_TERMINAL_DESTROYED)
	endobjective

	beginobjective(1, L_LIP_011, (DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD)) // "Locate conspiracy evidence"
		complete_flags(STAGEFLAG_XRAY_DONE)
		fail_flags(STAGEFLAG_CHAMBER_SWITCH_DESTROYED)
	endobjective

	beginobjective(2, L_LIP_009, (DIFFBIT_A | DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD)) // "Obtain and use lab technician disguise"
		complete_flags(STAGEFLAG_USED_DISGUISE)
		fail_flags(STAGEFLAG_DISGUISE_UNCOVERED)
	endobjective

	beginobjective(3, L_LIP_012, (DIFFBIT_A | DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD)) // "Gain access to autopsy lab"
		complete_flags(STAGEFLAG_ENTERED_LAB)
		require_object_collected(OBJ_KEYCARD)
		fail_flags(STAGEFLAG_DOORMAN_REJECTED)
		fail_flags(STAGEFLAG_DOORMAN_DEAD)
	endobjective

	beginobjective(4, L_LIP_013, (DIFFBIT_A | DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD)) // "Rescue the crash Survivor"
		complete_flags(STAGEFLAG_RESCUED_ELVIS)
		fail_flags(STAGEFLAG_ELVIS_DEAD)
		fail_flags(STAGEFLAG_CRATE_DESTROYED)
	endobjective

	chr(SPAWNFLAG_BASICGUARD, 0x00, PAD_LIP_039F, BODY_A51AIRMAN, HEAD_RANDOM, 0x0401, -1, -1, 1000, 20, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0000, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x01, PAD_LIP_03A2, BODY_A51AIRMAN, HEAD_RANDOM, 0x0402, -1, -1, 1000, 20, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0001, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x02, PAD_LIP_03A3, BODY_A51AIRMAN, HEAD_RANDOM, 0x0403, -1, -1, 1000, 20, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0002, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x03, PAD_LIP_03A4, BODY_A51AIRMAN, HEAD_RANDOM, 0x0404, -1, -1, 1000, 20, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CAN_HEARSPAWN | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0003, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x04, PAD_LIP_03A5, BODY_A51AIRMAN, HEAD_RANDOM, 0x0405, -1, -1, 1000, 20, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CAN_HEARSPAWN | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0004, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x05, PAD_LIP_0386, BODY_A51AIRMAN, HEAD_RANDOM, AILIST_DRAGON_GUARD, -1, -1, 2000, 20, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CAN_HEARSPAWN | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0005, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x06, PAD_LIP_0387, BODY_A51AIRMAN, HEAD_RANDOM, AILIST_DRAGON_GUARD, -1, -1, 2000, 20, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CAN_HEARSPAWN | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_01, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0006, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x07, PAD_LIP_03A7, BODY_A51AIRMAN, HEAD_RANDOM, AILIST_DRAGON_GUARD, -1, -1, 1000, 20, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_CAN_HEARSPAWN | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_02, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0007, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x08, PAD_LIP_03A6, BODY_A51AIRMAN, HEAD_RANDOM, AILIST_DRAGON_GUARD, -1, -1, 1000, 20, CHRFLAG0_CAN_RETREAT | CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_00008000 | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_02, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0008, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x09, PAD_LIP_03A8, BODY_A51AIRMAN, HEAD_RANDOM, AILIST_DRAGON_GUARD, -1, -1, 1000, 20, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_CAN_HEARSPAWN | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_02, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0009, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x0a, PAD_LIP_03CB, BODY_A51AIRMAN, HEAD_RANDOM, AILIST_DRAGON_GUARD, -1, -1, 1000, 20, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_CAN_HEARSPAWN | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_02, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x000a, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x0b, PAD_LIP_03A9, BODY_A51AIRMAN, HEAD_RANDOM, AILIST_DRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_03, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x000b, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x0c, PAD_LIP_03AA, BODY_A51AIRMAN, HEAD_RANDOM, 0x0406, -1, -1, 1000, 100, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_03, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x000c, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x0d, PAD_LIP_01BB, BODY_A51AIRMAN, HEAD_RANDOM, 0x0406, -1, -1, 1000, 100, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_03, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x000d, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x0e, PAD_LIP_01BC, BODY_A51AIRMAN, HEAD_RANDOM, 0x0406, -1, -1, 1000, 100, CHRFLAG0_CAN_THROW_GRENADES | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_03, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x000e, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x0f, PAD_LIP_03AB, BODY_AREA51GUARD, HEAD_RANDOM, 0x0407, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_04, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x000f, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x10, PAD_LIP_03AC, BODY_AREA51GUARD, HEAD_RANDOM, 0x0408, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_04, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0010, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x11, PAD_LIP_03AE, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_04, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0011, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BLUESIGHT, 0x3a, PAD_LIP_03AF, BODY_LABTECH, HEAD_RANDOM, AILIST_INIT_LABTECH_RECORDS, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000, 0, TEAM_ENEMY, SQUADRON_05, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x27, PAD_LIP_03BF, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 100, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_05, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0027, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x28, PAD_LIP_03C0, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 100, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_05, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0028, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x12, PAD_LIP_03B1, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_06, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0012, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_FIXEDHEIGHT | SPAWNFLAG_BLUESIGHT, 0x3b, PAD_LIP_03D8, BODY_LABTECH, HEAD_RANDOM, AILIST_LABTECH_LIGHTS, -1, -1, 1000, 6, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000, 0, TEAM_ENEMY, SQUADRON_06, 0x3b, 0, 0, 1, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x13, PAD_LIP_03B2, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_07, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0013, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BLUESIGHT, 0x3c, PAD_LIP_03C9, BODY_LABTECH, HEAD_RANDOM, AILIST_INIT_LABTECH_DOORS, 0x03c8, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_CANLOSEGUN, 0, TEAM_20, SQUADRON_07, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BLUESIGHT, 0x42, PAD_LIP_03B3, BODY_LABTECH, HEAD_RANDOM, AILIST_INIT_LABTECH_DOORS, 0x03c9, -1, 1000, 100, CHRFLAG0_GP1 | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_CANLOSEGUN, 0, TEAM_20, SQUADRON_07, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x14, PAD_LIP_00F7, BODY_AREA51GUARD, HEAD_RANDOM, 0x0409, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_08, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0014, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x15, PAD_LIP_00F0, BODY_AREA51GUARD, HEAD_RANDOM, 0x040a, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_08, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0015, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BLUESIGHT, 0x3d, PAD_LIP_03B4, BODY_LABTECH, HEAD_RANDOM, AILIST_INIT_LABTECH, -1, -1, 1000, 100, 0, 0, TEAM_ENEMY, SQUADRON_08, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_BASICGUARD, 0x18, PAD_LIP_00C7, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_09, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0018, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x1e, PAD_LIP_0130, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, 0x0132, -1, 1000, 100, CHRFLAG0_GP1 | CHRFLAG0_CAN_RETREAT | CHRFLAG0_00008000 | CHRFLAG0_CAN_TRAP | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0A, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x001e, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x19, PAD_LIP_0131, BODY_BIOTECH, HEAD_BIOTECH, AILIST_BIOTECH_GUARD, 0x0136, -1, 1000, 100, CHRFLAG0_GP1 | CHRFLAG0_CAN_RETREAT | CHRFLAG0_00008000 | CHRFLAG0_CAN_TRAP | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0A, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRUGGUN, 0x0019, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_TRANQUILIZER)
	chr(SPAWNFLAG_BASICGUARD, 0x1a, PAD_LIP_013B, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, 0x013c, -1, 1000, 100, CHRFLAG0_GP1 | CHRFLAG0_CAN_RETREAT | CHRFLAG0_00008000 | CHRFLAG0_CAN_TRAP | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0A, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x001a, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x1d, PAD_LIP_0137, BODY_BIOTECH, HEAD_BIOTECH, AILIST_BIOTECH_GUARD, 0x013a, -1, 1000, 100, CHRFLAG0_GP1 | CHRFLAG0_CAN_RETREAT | CHRFLAG0_00008000 | CHRFLAG0_CAN_TRAP | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0A, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRUGGUN, 0x001d, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_TRANQUILIZER)
	chr(SPAWNFLAG_BASICGUARD, 0x1b, PAD_LIP_0123, BODY_AREA51GUARD, HEAD_RANDOM, 0x040b, -1, -1, 1000, 100, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0C, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x001b, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x1c, PAD_LIP_0124, BODY_AREA51GUARD, HEAD_RANDOM, 0x040c, -1, -1, 1000, 100, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0C, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x001c, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(0, 0x3e, PAD_LIP_03C1, BODY_LABTECH, HEAD_RANDOM, AILIST_LABTECH_HARRYSMATE, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_SQUADALERTANYDIST, 0, TEAM_ENEMY, SQUADRON_0C, -1, 0, 0, 0, 0, 0)
	chr(0, 0x3f, PAD_LIP_03C2, BODY_LABTECH, HEAD_RANDOM, AILIST_LABTECH_KEYCARDGUY, -1, -1, 1000, 15, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_SQUADALERTANYDIST, 0, TEAM_ENEMY, SQUADRON_0C, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_ANTINONINTERACTABLE, 0x39, PAD_LIP_0121, BODY_AREA51GUARD, HEAD_BEAU1, AILIST_INIT_DOORMAN, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0C, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0039, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x33, PAD_LIP_03CC, BODY_BIOTECH, HEAD_BIOTECH, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_00, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRUGGUN, 0x0033, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_TRANQUILIZER)
	chr(SPAWNFLAG_BASICGUARD, 0x34, PAD_LIP_03CD, BODY_BIOTECH, HEAD_BIOTECH, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_00, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRUGGUN, 0x0034, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_TRANQUILIZER)
	chr(SPAWNFLAG_BASICGUARD, 0x37, PAD_LIP_03D0, BODY_AREA51GUARD, HEAD_RANDOM, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CANLOSEGUN, CHRFLAG1_ALLOWSOFTCOVER, TEAM_ENEMY, SQUADRON_00, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0037, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x2c, PAD_LIP_03D1, BODY_AREA51GUARD, HEAD_RANDOM, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CANLOSEGUN, CHRFLAG1_ALLOWSOFTCOVER, TEAM_ENEMY, SQUADRON_00, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x002c, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x2d, PAD_LIP_03D2, BODY_AREA51GUARD, HEAD_RANDOM, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CANLOSEGUN, CHRFLAG1_ALLOWSOFTCOVER, TEAM_ENEMY, SQUADRON_00, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x002d, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x2e, PAD_LIP_03D3, BODY_AREA51GUARD, HEAD_RANDOM, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HOLD_POSITION | CHRFLAG0_COVER_TYPE2 | CHRFLAG0_CANLOSEGUN, CHRFLAG1_ALLOWSOFTCOVER, TEAM_ENEMY, SQUADRON_00, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x002e, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x2f, PAD_LIP_03D4, BODY_BIOTECH, HEAD_BIOTECH, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0F, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRUGGUN, 0x002f, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_TRANQUILIZER)
	chr(SPAWNFLAG_BASICGUARD, 0x30, PAD_LIP_03D5, BODY_AREA51GUARD, HEAD_RANDOM, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0F, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0030, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x31, PAD_LIP_03D6, BODY_AREA51GUARD, HEAD_RANDOM, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0F, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0031, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x32, PAD_LIP_03D7, BODY_AREA51GUARD, HEAD_RANDOM, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0F, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0032, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x1f, PAD_LIP_03B5, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_CANLOSEGUN, CHRFLAG1_ALLOWSOFTCOVER, TEAM_ENEMY, SQUADRON_0D, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x001f, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x20, PAD_LIP_03B6, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_CANLOSEGUN, CHRFLAG1_ALLOWSOFTCOVER, TEAM_ENEMY, SQUADRON_0D, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0020, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x21, PAD_LIP_03B7, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_CANLOSEGUN, CHRFLAG1_ALLOWSOFTCOVER, TEAM_ENEMY, SQUADRON_0D, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0021, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_BASICGUARD, 0x22, PAD_LIP_03B8, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_00008000 | CHRFLAG0_HOLD_POSITION | CHRFLAG0_CANLOSEGUN, CHRFLAG1_ALLOWSOFTCOVER, TEAM_ENEMY, SQUADRON_0D, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0022, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
#if VERSION >= VERSION_NTSC_1_0
	chr(0, 0x23, PAD_LIP_03B9, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0E, -1, 0, 0, 0, 0, 0)
#else
	chr(SPAWNFLAG_BASICGUARD, 0x23, PAD_LIP_03B9, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0E, -1, 0, 0, 0, 0, 0)
#endif
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0023, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
#if VERSION >= VERSION_NTSC_1_0
	chr(0, 0x24, PAD_LIP_03BA, BODY_BIOTECH, HEAD_BIOTECH, AILIST_BIOTECH_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0E, -1, 0, 0, 0, 0, 0)
#else
	chr(SPAWNFLAG_BASICGUARD, 0x24, PAD_LIP_03BA, BODY_BIOTECH, HEAD_BIOTECH, AILIST_BIOTECH_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0E, -1, 0, 0, 0, 0, 0)
#endif
	weapon(0x0100, MODEL_CHRDRUGGUN, 0x0024, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_TRANQUILIZER)
#if VERSION >= VERSION_NTSC_1_0
	chr(0, 0x25, PAD_LIP_03BB, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0E, -1, 0, 0, 0, 0, 0)
#else
	chr(SPAWNFLAG_BASICGUARD, 0x25, PAD_LIP_03BB, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0E, -1, 0, 0, 0, 0, 0)
#endif
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0025, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
#if VERSION >= VERSION_NTSC_1_0
	chr(0, 0x26, PAD_LIP_03BC, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0E, -1, 0, 0, 0, 0, 0)
#else
	chr(SPAWNFLAG_BASICGUARD, 0x26, PAD_LIP_03BC, BODY_AREA51GUARD, HEAD_RANDOM, AILIST_SUPERDRAGON_GUARD, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_0E, -1, 0, 0, 0, 0, 0)
#endif
	weapon(0x0100, MODEL_CHRSUPERDRAGON, 0x0026, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_SUPERDRAGON)
	chr(SPAWNFLAG_ANTINONINTERACTABLE, 0x40, PAD_LIP_03BE, BODY_BIOTECH, HEAD_BIOTECH, AILIST_INIT_BIOTECH1, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000, 0, TEAM_NONCOMBAT, SQUADRON_0E, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSONICSCREWER, 0x0040, OBJFLAG_ASSIGNEDTOCHR | OBJFLAG_UNCOLLECTABLE, 0, 0, WEAPON_SCREWDRIVER)
	chr(SPAWNFLAG_ANTINONINTERACTABLE, 0x41, PAD_LIP_03DC, BODY_BIOTECH, HEAD_BIOTECH, AILIST_INIT_BIOTECH2, -1, -1, 1000, 100, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000, 0, TEAM_NONCOMBAT, SQUADRON_0E, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRSONICSCREWER, 0x0041, OBJFLAG_ASSIGNEDTOCHR | OBJFLAG_UNCOLLECTABLE, 0, 0, WEAPON_SCREWDRIVER)
	chr(SPAWNFLAG_BLUESIGHT, 0x43, PAD_LIP_01DE, BODY_OVERALL, HEAD_RANDOM, AILIST_INIT_MECHANIC, -1, -1, 1000, 5, CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000, 0, TEAM_ENEMY, SQUADRON_07, -1, 0, 0, 0, 0, 0)
	tag(0x2f, 1)
	hover_prop(0x0100, MODEL_HOVERBED, PAD_LIP_03BD, OBJFLAG_FALL | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_01000000 | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, OBJFLAG3_PUSHABLE | OBJFLAG3_GRABBABLE | OBJFLAG3_HOVERBEDSHIELD, 1000, HOVTYPE_BED)
	chr(0, 0x44, PAD_LIP_0196, BODY_A51AIRMAN, HEAD_RANDOM, AILIST_HIDDENGUY, -1, -1, 1000, 100, CHRFLAG0_CAN_RETREAT | CHRFLAG0_SURPRISABLE | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_00008000 | CHRFLAG0_SQUADALERTANYDIST | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_00, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0044, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(0, 0x47, PAD_LIP_0119, BODY_AREA51GUARD, HEAD_RANDOM, 0x0429, -1, -1, 1000, 100, CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_CANLOSEGUN, 0, TEAM_ENEMY, SQUADRON_00, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDRAGON, 0x0047, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DRAGON)
	chr(SPAWNFLAG_ANTINONINTERACTABLE, 0x48, PAD_LIP_020A, BODY_A51AIRMAN, HEAD_JONATHAN, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_CAN_RETREAT | CHRFLAG0_SURPRISABLE | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, 0, TEAM_ENEMY, SQUADRON_0A, -1, 0, 0, 0, 0, 0)
	weapon(0x0100, MODEL_CHRDY357, 0x0048, OBJFLAG_ASSIGNEDTOCHR, 0, 0, WEAPON_DY357MAGNUM)
	chr(SPAWNFLAG_ANTINONINTERACTABLE, 0x49, PAD_LIP_0197, BODY_A51AIRMAN, HEAD_RANDOM, GAILIST_IDLE, -1, -1, 1000, 100, CHRFLAG0_CAN_RETREAT | CHRFLAG0_SURPRISABLE | CHRFLAG0_FORCESAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS, 0, TEAM_ENEMY, SQUADRON_0A, -1, 0, 0, 0, 0, 0)
	chr(SPAWNFLAG_ANTINONINTERACTABLE | SPAWNFLAG_FIXEDHEIGHT, 0x38, PAD_LIP_0134, BODY_ELVIS1, HEAD_ELVIS, AILIST_ALIEN, -1, -1, 2000, 100, CHRFLAG0_SURPRISABLE | CHRFLAG0_SKIPSAFETYCHECKS | CHRFLAG0_HEAR_REQUIRE_LOS | CHRFLAG0_CANLOSEGUN, CHRFLAG1_DOINGIDLEANIMATION, TEAM_NONCOMBAT, SQUADRON_09, 0x1a, 0, 0, 1, 0, 0)
	door_scale(0x00008000)
	tag(0x35, 1)
	lift(0x0100, MODEL_A51_LIFT_STORE, PAD_LIP_0334, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x0334, 0x0335, -1, -1, 0x00000001, 0x00000002, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x20000000)
	door(0x0100, MODEL_A51LIFTDOOR, PAD_LIP_02E2, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_AISEETHROUGH, 0, OBJFLAG3_80000000, 1000, 0x0000e666, 0x00010000, 0x00000888, 0x00000888, 0x00000147, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000003c, 0x00000000, 0x00000000, 0x00000300)
	door(0x0100, MODEL_A51LIFTDOOR, PAD_LIP_02E1, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_AISEETHROUGH, 0, OBJFLAG3_80000000, 1000, 0x0000e666, 0x00010000, 0x00000888, 0x00000888, 0x00000147, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000003c, 0x00000000, 0x00000000, 0x00000300)
	lift_door(-2, -3, 0)
	lift_door(-2, -4, 1)
	tag(0x39, 1)
	lift(0x0100, MODEL_A51_LIFT_THINWALL, PAD_LIP_0336, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x0336, 0x0337, -1, -1, 0x00000001, 0x00000002, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x20000000)
	door(0x0100, MODEL_A51LIFTDOOR, PAD_LIP_02E4, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_AISEETHROUGH, 0, OBJFLAG3_80000000, 1000, 0x0000cccc, 0x00010000, 0x00000888, 0x00000888, 0x00000147, DOORFLAG_FLIP, DOORTYPE_SLIDING, 0x00000000, 0x0000003c, 0x00000000, 0x00000000, 0x00000300)
	door(0x0100, MODEL_A51LIFTDOOR, PAD_LIP_02E3, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_AISEETHROUGH, 0, OBJFLAG3_80000000, 1000, 0x0000cccc, 0x00010000, 0x00000888, 0x00000888, 0x00000147, DOORFLAG_FLIP, DOORTYPE_SLIDING, 0x00000000, 0x0000003c, 0x00000000, 0x00000000, 0x00000300)
	lift_door(-2, -3, 0)
	lift_door(-2, -4, 1)
	door_scale(0x00010000)
	tag(0x00, 1)
	weapon(0x0180, MODEL_LABCOAT, PAD_LIP_042B, OBJFLAG_FALL, 0, 0, WEAPON_DISGUISE40)
	rename_object(-1, WEAPON_DISGUISE40, L_LIP_015, L_LIP_016, L_LIP_017, L_LIP_018, L_LIP_019) // "Obtain lab clothes."
	tag(0x3e, 1)
	weapon(0x0180, MODEL_LABCOAT, PAD_LIP_042C, OBJFLAG_FALL, 0, 0, WEAPON_DISGUISE40)
	rename_object(-1, WEAPON_DISGUISE40, L_LIP_015, L_LIP_016, L_LIP_017, L_LIP_018, L_LIP_019) // "Obtain lab clothes."
	tag(0x3f, 1)
	weapon(0x0180, MODEL_LABCOAT, PAD_LIP_042D, OBJFLAG_FALL, 0, 0, WEAPON_DISGUISE40)
	rename_object(-1, WEAPON_DISGUISE40, L_LIP_015, L_LIP_016, L_LIP_017, L_LIP_018, L_LIP_019) // "Obtain lab clothes."
	tag(0x40, 1)
	weapon(0x0180, MODEL_LABCOAT, PAD_LIP_042E, OBJFLAG_FALL, 0, 0, WEAPON_DISGUISE40)
	rename_object(-1, WEAPON_DISGUISE40, L_LIP_015, L_LIP_016, L_LIP_017, L_LIP_018, L_LIP_019) // "Obtain lab clothes."
	tag(0x41, 1)
	weapon(0x0180, MODEL_LABCOAT, PAD_LIP_042F, OBJFLAG_FALL, 0, 0, WEAPON_DISGUISE40)
	rename_object(-1, WEAPON_DISGUISE40, L_LIP_015, L_LIP_016, L_LIP_017, L_LIP_018, L_LIP_019) // "Obtain lab clothes."
	tag(0x03, 1)
	singlemonitor(0x0033, MODEL_SINISTERSTATION, PAD_LIP_0428, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 3)
	tag(0x02, 1)
	singlemonitor(0x0033, MODEL_SINISTERSTATION, PAD_LIP_0427, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 3)
	tag(0x01, 1)
	singlemonitor(0x0033, MODEL_SINISTERSTATION, PAD_LIP_0429, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 3)
	tag(0x04, 1)
	singlemonitor(0x0033, MODEL_SINISTERSTATION, PAD_LIP_0426, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 3)
	tag(0x05, 1)
	weapon(0x0180, MODEL_CHRDATATHIEF, PAD_LIP_00DA, OBJFLAG_FALL | OBJFLAG_UNCOLLECTABLE, OBJFLAG2_INVISIBLE, 0, WEAPON_DATAUPLINK)
	rename_object(-1, WEAPON_DATAUPLINK, L_LIP_024, L_LIP_025, L_LIP_026, L_LIP_027, L_LIP_028) // "Obtain Data Uplink."
	tag(0x3a, 1)
	weapon(0x0180, MODEL_CHRDATATHIEF, PAD_LIP_00DA, OBJFLAG_FALL | OBJFLAG_UNCOLLECTABLE, OBJFLAG2_INVISIBLE, 0, WEAPON_DATAUPLINK)
	rename_object(-1, WEAPON_DATAUPLINK, L_LIP_024, L_LIP_025, L_LIP_026, L_LIP_027, L_LIP_028) // "Obtain Data Uplink."
	tag(0x3c, 2)
	tag(0x3d, 2)
	singlemonitor(0x0033, MODEL_SINISTERSTATION, PAD_LIP_03C6, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOANTI, 0, 1000, 3)
	singlemonitor(0x0033, MODEL_SINISTERSTATION, PAD_LIP_03C7, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOANTI, 0, 1000, 3)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_027F, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_027E, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_027D, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_027C, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_027A, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_027B, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0278, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_0279, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0277, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_0276, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0274, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000002, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_0275, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000002, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0273, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000002, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_0272, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000002, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0270, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_0271, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_026F, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_026E, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_026C, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_026D, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_026B, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_026A, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0268, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_0269, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	tag(0x44, 2)
	tag(0x45, 2)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0266, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_0267, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	tag(0x2b, 4)
	tag(0x2c, 4)
	tag(0x2d, 4)
	tag(0x2e, 4)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02AA, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000080, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02AB, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDBACK, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000080, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02AC, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000080, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02AD, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDBACK, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000080, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	tag(0x07, 2)
	tag(0x08, 2)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0280, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000040, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_0281, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDBACK, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000040, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	tag(0x09, 2)
	tag(0x0a, 2)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02B7, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02B8, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	tag(0x0b, 2)
	tag(0x0c, 2)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02B9, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02BA, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	tag(0x0d, 2)
	tag(0x0e, 2)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02BB, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02BC, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0283, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_0282, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0284, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_0285, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_028B, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_028A, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_GL, PAD_LIP_0286, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, DOORFLAG_WINDOWED, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x01f407d0, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0287, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_GL, PAD_LIP_0289, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, DOORFLAG_WINDOWED, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x01f407d0, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_0288, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02A4, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000000, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02A5, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000020, 0x0000003c, 0x00000000, 0x00000000, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02A6, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000000, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_SECRET, PAD_LIP_028E, OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0000d555, 0x0000d555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000001, 0x0000003c, 0x00000000, 0x00000000, 0x00000100)
	door(0x0100, MODEL_A51_VERT_DOOR_RIGHT, PAD_LIP_0292, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_LEFT, PAD_LIP_0293, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_VERT_DOOR_RIGHT, PAD_LIP_0294, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_LEFT, PAD_LIP_0295, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51GATE_L, PAD_LIP_02B5, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00008000, 0, DOORTYPE_SLIDING, 0x00000008, 0x00000384, 0x00000000, 0x00000001, 0x00000f00)
	door(0x0100, MODEL_A51GATE_R, PAD_LIP_02B6, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00004000, 0, DOORTYPE_SLIDING, 0x00000008, 0x00000384, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_VERT_DOOR_RIGHT, PAD_LIP_0299, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000c000, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_LEFT, PAD_LIP_0298, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000c000, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00000000)
	tag(0x4a, 2)
	tag(0x4b, 2)
	door(0x0100, MODEL_A51_HORIZ_DOOR_GL, PAD_LIP_02A8, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT | OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, DOORFLAG_WINDOWED, DOORTYPE_VERTICAL, 0x00000040, 0x00000258, 0x01f407d0, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02A7, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDBACK | OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000040, 0x00000258, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_VERT_DOOR_RIGHT, PAD_LIP_029A, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_LEFT, PAD_LIP_029B, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_VERT_DOOR_RIGHT, PAD_LIP_029C, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000c000, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_LEFT, PAD_LIP_029D, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000c000, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00000000)
	tag(0x13, 1)
	door(0x0100, MODEL_A51_VERT_DOOR_RIGHT, PAD_LIP_029E, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000c000, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_LEFT, PAD_LIP_029F, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000c000, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00000000)
	tag(0x30, 3)
	tag(0x31, 3)
	tag(0x11, 1)
	door(0x0100, MODEL_A51_VERT_DOOR_RIGHT, PAD_LIP_02A1, OBJFLAG_00000010 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_DEACTIVATED, 0, OBJFLAG3_AUTOCUTSCENESOUNDS, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_LEFT, PAD_LIP_02A0, OBJFLAG_00000010 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_028C, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000e666, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, DOORFLAG_FLIP, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000000, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_028D, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000e666, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000000, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02AE, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000e666, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, DOORFLAG_FLIP, DOORTYPE_SLIDING, 0x00000010, 0x00000384, 0x00000000, 0x00000000, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_028F, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000000, 0x00000300)
	tag(0x12, 1)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_0290, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000080, 0x00000384, 0x00000000, 0x00000000, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_0291, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000000, 0x00000384, 0x00000000, 0x00000000, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02A2, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000a666, 0x0000a666, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000004, 0x00000384, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02A3, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000a666, 0x0000a666, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000004, 0x00000384, 0x00000000, 0xffffffff, 0x00000000)
	stdobject(0x00e6, MODEL_LAB_CONTAINER, PAD_LIP_031C, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100, OBJFLAG2_REMOVEWHENDESTROYED, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE1, PAD_LIP_02E5, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE2, PAD_LIP_02E6, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE3, PAD_LIP_02E7, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE1, PAD_LIP_02E8, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE2, PAD_LIP_02E9, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE3, PAD_LIP_02EA, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE1, PAD_LIP_02EB, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE2, PAD_LIP_02EC, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE3, PAD_LIP_02ED, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE1, PAD_LIP_02EE, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE2, PAD_LIP_02EF, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE3, PAD_LIP_02F0, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE1, PAD_LIP_02F1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE2, PAD_LIP_02F2, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE3, PAD_LIP_02F3, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE1, PAD_LIP_02F4, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE2, PAD_LIP_02F5, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE3, PAD_LIP_02F6, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE1, PAD_LIP_02F7, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	blocked_path(2, 0x0111, 0x01bb)
	conditional_scenery(1, 0, 2)
	door(0x0100, MODEL_A51_UNEXP1, PAD_LIP_0422, OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_PATHBLOCKER | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_DEACTIVATED, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS | OBJFLAG2_AICANNOTUSE, 0, 1000, 0x00000000, 0x00010000, 0x03e80000, 0x03e80000, 0x00010000, 0, DOORTYPE_SLIDING, 0x00000080, 0x00000001, 0x00010000, 0x00000000, 0x00000000)
#if VERSION >= VERSION_NTSC_1_0
	stdobject(0x0100, MODEL_A51_EXP1, PAD_LIP_0421, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
#else
	stdobject(0x0100, MODEL_A51_EXP1, PAD_LIP_0421, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
#endif
	tag(0x18, -2)
	tag(0x46, 6)
	tag(0x47, 6)
	tag(0x48, 8)
	tag(0x49, 8)
	tag(0x38, 1)
	lift(0x0100, MODEL_A51_LIFT_CONTROL, PAD_LIP_032A, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x032a, 0x032b, -1, -1, 0x00000001, 0x00000005, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x16000000)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_0330, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000e666, 0x0000e666, 0x00008e38, 0x00008e38, 0x00000444, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_0331, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000e666, 0x0000e666, 0x00008e38, 0x00008e38, 0x00000444, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0xffffffff, VERSION >= VERSION_NTSC_1_0 ? 0x00000000 : 0x00000300)
	lift_door(-2, -3, 0)
	lift_door(-2, -4, 0)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_0332, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000e666, 0x0000e666, 0x00008e38, 0x00008e38, 0x00000444, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_0333, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000e666, 0x0000e666, 0x00008e38, 0x00008e38, 0x00000444, 0, DOORTYPE_SLIDING, 0x00000000, 0x0000012c, 0x00000000, 0xffffffff, VERSION >= VERSION_NTSC_1_0 ? 0x00000000 : 0x00000300)
	lift_door(-2, -7, 1)
	lift_door(-2, -8, 1)
	tag(0x14, 2)
	tag(0x15, 2)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02B3, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT, 0, 1000, 0x0000e666, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, DOORFLAG_FLIP, DOORTYPE_SLIDING, 0x00000010, 0x00000384, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02B4, OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT, 0, 1000, 0x0000e666, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000010, 0x00000384, 0x00000000, 0xffffffff, VERSION >= VERSION_NTSC_1_0 ? 0x00000000 : 0x00000300)
	tag(0x33, 2)
	tag(0x34, 2)
	door(0x0100, MODEL_A51_VERT_DOOR_RIGHT, PAD_LIP_02AF, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDBACK | OBJFLAG2_AICANNOTUSE, OBJFLAG3_AUTOCUTSCENESOUNDS, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000010, 0x00000384, 0x00000000, 0x00000001, 0x00000300)
	door(0x0100, MODEL_A51_VERT_DOOR_LEFT, PAD_LIP_02B0, OBJFLAG_00000010 | OBJFLAG_DEACTIVATED, OBJFLAG2_LOCKEDFRONT | OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000cccc, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0, DOORTYPE_SLIDING, 0x00000010, 0x00000384, 0x00000000, 0xffffffff, 0x00000000)
#if VERSION >= VERSION_NTSC_1_0
	door(0x0100, MODEL_DOOR_ROLLERTRAIN, PAD_LIP_0321, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000f333, 0x0000c000, 0x000031c7, 0x000031c7, 0x000002fc, DOORFLAG_0004, DOORTYPE_VERTICAL, 0x00000002, 0x0000012c, 0x00000000, 0x00000000, 0x00000000)
	door(0x0100, MODEL_DOOR_ROLLERTRAIN, PAD_LIP_0327, OBJFLAG_DEACTIVATED, OBJFLAG2_AICANNOTUSE, 0, 1000, 0x0000f333, 0x0000c000, 0x000031c7, 0x000031c7, 0x000002fc, DOORFLAG_0004, DOORTYPE_VERTICAL, 0x00000002, 0x0000012c, 0x00000000, 0x00000000, 0x00000000)
#else
	door(0x0100, MODEL_DOOR_ROLLERTRAIN, PAD_LIP_0321, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000c000, 0x000031c7, 0x000031c7, 0x000002fc, DOORFLAG_0004, DOORTYPE_VERTICAL, 0x00000002, 0x0000012c, 0x00000000, 0x00000000, 0x00000000)
	door(0x0100, MODEL_DOOR_ROLLERTRAIN, PAD_LIP_0327, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000c000, 0x000031c7, 0x000031c7, 0x000002fc, DOORFLAG_0004, DOORTYPE_VERTICAL, 0x00000002, 0x0000012c, 0x00000000, 0x00000000, 0x00000000)
#endif
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02B2, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, DOORFLAG_AUTOMATIC, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02B1, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	tag(0x17, 1)
	hover_prop(0x00eb, MODEL_HOVERCRATE1, PAD_LIP_01C7, OBJFLAG_FALL | OBJFLAG_00000100 | OBJFLAG_UNCOLLECTABLE | OBJFLAG_01000000 | OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_HOVERPROP_20000000, OBJFLAG2_IMMUNETOANTI | OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_REMOVEWHENDESTROYED | OBJFLAG2_BULLETPROOF | OBJFLAG2_HOVERPROP_80000000, OBJFLAG3_PUSHABLE | OBJFLAG3_GRABBABLE, 1000, HOVTYPE_CRATE)
	tag(0x06, 1)
	key(0x0080, MODEL_KEYCARD, 0x003f, OBJFLAG_ASSIGNEDTOCHR, 0, 0, 32)
	rename_object(-1, WEAPON_KEYCARD47, L_LIP_032, L_LIP_033, L_LIP_034, L_LIP_035, L_LIP_036) // "Obtain medlab 2 key card."

	// @bug: This keycard is given to guard 0x26 rather than being left
	// unassigned. This breaks the keycard hot potato which is supposed to
	// happen in the last room, because the keycard is not given to anyone until
	// there's one guard left, and you can just kill guard 0x26 for it.
	tag(0x10, 1)
	key(0x0080, MODEL_KEYCARD, 0x0026, OBJFLAG_ASSIGNEDTOCHR, 0, 0, 128)
	rename_object(-1, WEAPON_KEYCARD48, L_LIP_059, L_LIP_060, L_LIP_061, L_LIP_062, L_LIP_063) // "Obtain op room key card."

	stdobject(0x0100, MODEL_A51BOARD, PAD_LIP_03C4, OBJFLAG_FALL | OBJFLAG_00000100 | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_01000000 | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02BD, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02BE, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02BF, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02C0, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02C1, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02C2, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_BOT, PAD_LIP_02C3, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0000003c, 0x00000000, 0x00000001, 0x00000100)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02C4, OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x00085555, 0x00085555, 0x00001999, 0, DOORTYPE_VERTICAL, 0x00000000, 0x0fffffff, 0x00000000, 0xffffffff, 0x00000000)
	glass(0x0100, MODEL_MEDLABWIN1, PAD_LIP_0436, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_ORTHOGONAL | OBJFLAG_PATHBLOCKER | OBJFLAG_AISEETHROUGH, 0, 0, 1000)
	glass(0x0100, MODEL_MEDLABWIN2, PAD_LIP_0437, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_ORTHOGONAL | OBJFLAG_PATHBLOCKER | OBJFLAG_AISEETHROUGH, 0, 0, 1000)
	glass(0x0100, MODEL_MEDLABWIN2, PAD_LIP_0438, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_ORTHOGONAL | OBJFLAG_PATHBLOCKER | OBJFLAG_AISEETHROUGH, 0, 0, 1000)
	glass(0x0100, MODEL_MEDLABWIN1, PAD_LIP_0439, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_ORTHOGONAL | OBJFLAG_PATHBLOCKER | OBJFLAG_INVINCIBLE | OBJFLAG_AISEETHROUGH, OBJFLAG2_BULLETPROOF, 0, 1000)
	glass(0x0100, MODEL_MEDLABWIN2, PAD_LIP_043A, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_ORTHOGONAL | OBJFLAG_PATHBLOCKER | OBJFLAG_INVINCIBLE | OBJFLAG_AISEETHROUGH, OBJFLAG2_BULLETPROOF, 0, 1000)
	glass(0x0100, MODEL_MEDLABWIN2, PAD_LIP_043B, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_ORTHOGONAL | OBJFLAG_PATHBLOCKER | OBJFLAG_INVINCIBLE | OBJFLAG_AISEETHROUGH, OBJFLAG2_BULLETPROOF, 0, 1000)
	tinted_glass(0x0100, MODEL_DD_WINDOW, PAD_LIP_0446, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_ORTHOGONAL | OBJFLAG_PATHBLOCKER | OBJFLAG_INVINCIBLE | OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000, 0x0096012c)
	tinted_glass(0x0100, MODEL_DD_WINDOW, PAD_LIP_0445, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_ORTHOGONAL | OBJFLAG_PATHBLOCKER | OBJFLAG_INVINCIBLE | OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000, 0x0096012c)
	tinted_glass(0x0100, MODEL_DD_WINDOW, PAD_LIP_043D, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ORTHOGONAL | OBJFLAG_INVINCIBLE | OBJFLAG_FORCENOBOUNCE, OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x04b007d0)
	tinted_glass(0x0100, MODEL_DD_WINDOW, PAD_LIP_043E, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ORTHOGONAL | OBJFLAG_INVINCIBLE | OBJFLAG_FORCENOBOUNCE, OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x04b007d0)
	tinted_glass(0x0100, MODEL_DD_WINDOW, PAD_LIP_043F, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ORTHOGONAL | OBJFLAG_INVINCIBLE | OBJFLAG_FORCENOBOUNCE, OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x04b007d0)
	tinted_glass(0x0100, MODEL_DD_WINDOW, PAD_LIP_0440, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ORTHOGONAL | OBJFLAG_INVINCIBLE | OBJFLAG_FORCENOBOUNCE, OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x04b007d0)
	tinted_glass(0x0100, MODEL_DD_WINDOW, PAD_LIP_0441, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ORTHOGONAL | OBJFLAG_INVINCIBLE | OBJFLAG_FORCENOBOUNCE, OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x04b007d0)
	tinted_glass(0x0100, MODEL_DD_WINDOW, PAD_LIP_0442, OBJFLAG_00000002 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ORTHOGONAL | OBJFLAG_INVINCIBLE | OBJFLAG_FORCENOBOUNCE, OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x04b007d0)
	tag(0x19, 1)
	autogun(0x00c0, MODEL_A51_ROOFGUN, PAD_LIP_0405, OBJFLAG_UPSIDEDOWN, OBJFLAG2_REMOVEWHENDESTROYED, 0, 1000, 0x0108, 0x00004000, 0xffffc000, 0x000000da, 0x00140000)
	tag(0x1a, 2)
	tag(0x22, 2)
	lift(0x0100, MODEL_CHAMBER, PAD_LIP_033C, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x033c, 0x033d, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x00000000)
	singlemonitor(0x0100, MODEL_MODEMBOX, PAD_LIP_045C, OBJFLAG_00000002 | OBJFLAG_DEACTIVATED, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 18)
	tag(0x1c, 2)
	tag(0x24, 2)
	lift(0x0100, MODEL_CHAMBER, PAD_LIP_0340, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x0340, 0x0341, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x00000000)
	singlemonitor(0x0100, MODEL_MODEMBOX, PAD_LIP_0459, OBJFLAG_00000002 | OBJFLAG_DEACTIVATED, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 18)
	tag(0x1e, 2)
	tag(0x26, 2)
	lift(0x0100, MODEL_CHAMBER, PAD_LIP_0344, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x0344, 0x0345, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x00000000)
	singlemonitor(0x0100, MODEL_MODEMBOX, PAD_LIP_045A, OBJFLAG_00000002 | OBJFLAG_DEACTIVATED, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 18)
	tag(0x20, 2)
	tag(0x28, 2)
	lift(0x0100, MODEL_CHAMBER, PAD_LIP_0348, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x0348, 0x0349, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x00000000)
	singlemonitor(0x0100, MODEL_MODEMBOX, PAD_LIP_045B, OBJFLAG_00000002 | OBJFLAG_DEACTIVATED, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 18)
	tag(0x1b, 2)
	tag(0x23, 2)
	lift(0x0100, MODEL_CHAMBER, PAD_LIP_033F, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x033f, 0x033e, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x00000000)
	singlemonitor(0x0100, MODEL_MODEMBOX, PAD_LIP_045E, OBJFLAG_00000002 | OBJFLAG_DEACTIVATED, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 18)
	tag(0x1d, 2)
	tag(0x25, 2)
	lift(0x0100, MODEL_CHAMBER, PAD_LIP_0343, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x0343, 0x0342, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x00000000)
	singlemonitor(0x0100, MODEL_MODEMBOX, PAD_LIP_045F, OBJFLAG_00000002 | OBJFLAG_DEACTIVATED, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 18)
	tag(0x1f, 2)
	tag(0x27, 2)
	lift(0x0100, MODEL_CHAMBER, PAD_LIP_0347, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x0347, 0x0346, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x00000000)
	singlemonitor(0x0100, MODEL_MODEMBOX, PAD_LIP_0460, OBJFLAG_00000002 | OBJFLAG_DEACTIVATED, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 18)
	tag(0x21, 2)
	tag(0x29, 2)
	lift(0x0100, MODEL_CHAMBER, PAD_LIP_034B, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_INVINCIBLE | OBJFLAG_UNCOLLECTABLE | OBJFLAG_FORCENOBOUNCE | OBJFLAG_01000000 | OBJFLAG_CANNOT_ACTIVATE | OBJFLAG_AISEETHROUGH, OBJFLAG2_NOFALL | OBJFLAG2_FALLWITHOUTROTATION | OBJFLAG2_IMMUNETOGUNFIRE | OBJFLAG2_BULLETPROOF | OBJFLAG2_IMMUNETOEXPLOSIONS, 0, 1000, 0x034b, 0x034a, -1, -1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x00000000)
	singlemonitor(0x0100, MODEL_MODEMBOX, PAD_LIP_045D, OBJFLAG_00000002 | OBJFLAG_DEACTIVATED, OBJFLAG2_IMMUNETOANTI, OBJFLAG3_INTERACTABLE, 1000, 18)
	tag(0x32, 1)
	stdobject(0x0100, MODEL_A51_CRATE1, -1, OBJFLAG_FALL | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0461, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0462, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0463, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0464, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0465, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0466, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0467, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0468, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0469, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_046A, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_046B, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_046C, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_046D, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_046E, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_046F, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0470, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0471, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0472, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0473, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_0474, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, OBJFLAG2_IMMUNETOGUNFIRE, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0476, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0477, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0479, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_047A, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_047B, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_047C, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_047D, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_047E, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_047F, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0480, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0481, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0482, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0483, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0484, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0485, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	tag(0x3b, 1)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0486, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0487, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0488, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_DD_CHAIR, PAD_LIP_0489, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_0491, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_0492, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_0493, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_0494, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_0495, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_0496, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_0497, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_0498, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_0499, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_049A, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_049B, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_049C, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_049D, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_049E, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_049F, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_04A0, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_04A1, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_04A2, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51WASTEBIN, PAD_LIP_04A3, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51DIVIDE, PAD_LIP_04A4, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51DIVIDE, PAD_LIP_04A5, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51DIVIDE, PAD_LIP_04A6, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51DIVIDE, PAD_LIP_04A7, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51DIVIDE, PAD_LIP_04A8, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51DIVIDE, PAD_LIP_04A9, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51DIVIDE, PAD_LIP_04AA, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51DIVIDE, PAD_LIP_04AB, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51DIVIDE, PAD_LIP_04AC, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE3, PAD_LIP_031A, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51_CRATE1, PAD_LIP_031B, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_BARREL, PAD_LIP_04B7, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_BARREL, PAD_LIP_04B8, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_BARREL, PAD_LIP_04B9, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_BARREL, PAD_LIP_04BA, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_BARREL, PAD_LIP_04BB, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_BARREL, PAD_LIP_04BC, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_BARREL, PAD_LIP_04BD, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_BARREL, PAD_LIP_04BE, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02C7, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02C8, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02C9, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02CA, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02CB, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02CC, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02CD, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02CE, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02CF, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_HORIZ_DOOR_TOP, PAD_LIP_02D0, OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_DEACTIVATED, 0, 0, 1000, 0x0000f333, 0x0000f333, 0x0001aaaa, 0x0001aaaa, 0x00000ccc, 0, DOORTYPE_VERTICAL, 0x00000000, 0x00000078, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02D1, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02D2, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02D3, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02D4, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02D5, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02D6, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02D7, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02D8, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02D9, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02DA, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	door(0x0100, MODEL_A51_VERT_DOOR_ST, PAD_LIP_02DB, OBJFLAG_AISEETHROUGH | OBJFLAG_DEACTIVATED | OBJFLAG_DOOR_OPENTOFRONT, 0, 0, 1000, 0x005a0000, 0x03e80000, 0x012c0000, 0x012c0000, 0x00030000, 0, DOORTYPE_SWINGING, 0x00000000, 0x000005dc, 0x00000000, 0x00000000, 0x00000b00)
	stdobject(0x0100, MODEL_A51TABLE, PAD_LIP_04D4, OBJFLAG_FALL | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR, 0, 0, 1000)
	stdobject(0x0100, MODEL_A51GRATE, PAD_LIP_0443, OBJFLAG_00000008 | OBJFLAG_XTOPADBOUNDS | OBJFLAG_YTOPADBOUNDS | OBJFLAG_ZTOPADBOUNDS | OBJFLAG_00000100 | OBJFLAG_IGNOREFLOORCOLOUR | OBJFLAG_IGNOREROOMCOLOUR | OBJFLAG_INVINCIBLE, 0, 0, 1000)
	tag(0x4c, 2)
	tag(0x4d, 2)
	weapon(0x0100, MODEL_CHRFALCON2SIL, PAD_LIP_03DB, OBJFLAG_FALL, 0, 0, WEAPON_FALCON2_SILENCER)
	weapon(0x0100, MODEL_CHRFALCON2SIL, PAD_LIP_03DB, OBJFLAG_FALL, 0, 0, WEAPON_FALCON2_SILENCER)
	link_guns(-1, -2)
	tag(0x4e, 1)
	weapon(0x0100, MODEL_CHRMAIANPISTOL, PAD_LIP_0389, OBJFLAG_FALL | OBJFLAG_INVINCIBLE | OBJFLAG_FORCENOBOUNCE, 0, 0, WEAPON_PHOENIX)
	tag(0x42, 1)
	shield(0x0100, MODEL_CHRSHIELD, 0x0004, OBJFLAG_FALL | OBJFLAG_ASSIGNEDTOCHR, OBJFLAG2_EXCLUDE_SA | OBJFLAG2_EXCLUDE_PA | OBJFLAG2_EXCLUDE_PD, 0, 1000)
	tag(0x43, 1)
	shield(0x0100, MODEL_CHRSHIELD, PAD_LIP_0474, OBJFLAG_FALL, OBJFLAG2_EXCLUDE_PA | OBJFLAG2_EXCLUDE_PD, 0, 1000)
	endprops
};

s32 intro[] = {
	spawn(PAD_LIP_03A1)
	intro_weapon(WEAPON_FALCON2_SILENCER, -1)
	ammo(AMMOTYPE_PISTOL, 100)
	intro_weapon(WEAPON_XRAYSCANNER, -1)
	outfit(OUTFIT_DEFAULT)
	endintro
};

s32 path00[] = {
	PAD_LIP_0194,
	PAD_LIP_0193,
	PAD_LIP_0196,
	PAD_LIP_0195,
	-1,
};

s32 path01[] = {
	PAD_LIP_019A,
	PAD_LIP_019C,
	PAD_LIP_018B,
	PAD_LIP_018A,
	PAD_LIP_018F,
	PAD_LIP_01A0,
	PAD_LIP_0190,
	PAD_LIP_019E,
	PAD_LIP_0199,
	-1,
};

s32 path02[] = {
	PAD_LIP_0190,
	PAD_LIP_019E,
	PAD_LIP_0199,
	PAD_LIP_019A,
	PAD_LIP_019C,
	PAD_LIP_018B,
	PAD_LIP_018A,
	PAD_LIP_018F,
	PAD_LIP_01A0,
	-1,
};

s32 path03[] = {
	PAD_LIP_018D,
	PAD_LIP_0189,
	PAD_LIP_0191,
	PAD_LIP_018F,
	PAD_LIP_018E,
	-1,
};

s32 path04[] = {
	PAD_LIP_0185,
	PAD_LIP_0186,
	PAD_LIP_0187,
	PAD_LIP_0182,
	PAD_LIP_0188,
	-1,
};

s32 path05[] = {
	PAD_LIP_01BD,
	PAD_LIP_01BC,
	PAD_LIP_01BB,
	PAD_LIP_01BC,
	PAD_LIP_01BD,
	-1,
};

s32 path06[] = {
	PAD_LIP_0111,
	PAD_LIP_010F,
	PAD_LIP_011A,
	PAD_LIP_0118,
	PAD_LIP_011A,
	PAD_LIP_010F,
	PAD_LIP_0111,
	-1,
};

s32 path07[] = {
	PAD_LIP_0112,
	PAD_LIP_0113,
	PAD_LIP_0100,
	PAD_LIP_0102,
	PAD_LIP_0104,
	PAD_LIP_0102,
	PAD_LIP_0100,
	PAD_LIP_0113,
	-1,
};

s32 path08[] = {
	PAD_LIP_00F7,
	PAD_LIP_00FA,
	PAD_LIP_00FB,
	PAD_LIP_00FC,
	PAD_LIP_00FB,
	PAD_LIP_00FA,
	PAD_LIP_00F7,
	PAD_LIP_00F8,
	PAD_LIP_00F9,
	PAD_LIP_00FA,
	-1,
};

s32 path09[] = {
	PAD_LIP_00F0,
	PAD_LIP_00F2,
	PAD_LIP_00F3,
	PAD_LIP_00F4,
	PAD_LIP_00F3,
	PAD_LIP_00F2,
	PAD_LIP_00F0,
	PAD_LIP_00EF,
	PAD_LIP_00F3,
	PAD_LIP_00F2,
	-1,
};

s32 path10[] = {
	PAD_LIP_0123,
	PAD_LIP_0124,
	-1,
};

s32 path11[] = {
	PAD_LIP_0124,
	PAD_LIP_0123,
	-1,
};

s32 path12[] = {
	PAD_LIP_0118,
	PAD_LIP_0119,
	PAD_LIP_011A,
	PAD_LIP_010D,
	PAD_LIP_010E,
	PAD_LIP_010F,
	PAD_LIP_0110,
	PAD_LIP_0111,
	PAD_LIP_0112,
	PAD_LIP_0113,
	PAD_LIP_0114,
	PAD_LIP_0100,
	PAD_LIP_0114,
	PAD_LIP_0113,
	PAD_LIP_0112,
	PAD_LIP_0111,
	PAD_LIP_0110,
	PAD_LIP_010F,
	PAD_LIP_010E,
	PAD_LIP_010D,
	PAD_LIP_011A,
	PAD_LIP_0119,
	-1,
};

s32 path13[] = {
	PAD_LIP_00ED,
	PAD_LIP_0100,
	PAD_LIP_00ED,
	-1,
};

s32 path14[] = {
	PAD_LIP_0100,
	PAD_LIP_0118,
	PAD_LIP_0100,
	PAD_LIP_00ED,
	-1,
};

u8 func1400_give_datauplinks[] = {
	yield
	set_chr_team(CHR_ANTI, TEAM_22)
	give_object_to_chr(OBJ_DATAUPLINK_BOND, CHR_BOND)
	give_object_to_chr(OBJ_DATAUPLINK_COOP, CHR_COOP)
	set_ailist(CHR_SELF, GAILIST_REBUILD_GROUPS)
	endlist
};

u8 func1007_check_disguise_collected[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_has_object(CHR_P1P2, OBJ_LABCOAT1, /*goto*/ 0x06)
		if_chr_has_object(CHR_P1P2, OBJ_LABCOAT2, /*goto*/ 0x06)
		if_chr_has_object(CHR_P1P2, OBJ_LABCOAT3, /*goto*/ 0x06)
		if_chr_has_object(CHR_P1P2, OBJ_LABCOAT4, /*goto*/ 0x06)
		if_chr_has_object(CHR_P1P2, OBJ_LABCOAT5, /*goto*/ 0x06)
	endloop(0x04)

	label(0x06)
	dprint 'D','I','S','G','U','I','S','E','D',' ','U','P','\n',0,

	beginloop(0x08)
		if_chr_has_hiddenflag(CHR_P1P2, CHRHFLAG_DISGUISED, /*goto*/ LABEL_2D)
	endloop(0x08)

	label(LABEL_2D)
	set_stage_flag(STAGEFLAG_USED_DISGUISE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1026_check_records_destroyed[] = {
	beginloop(0x04)
		if_object_in_good_condition(0x04, /*goto*/ 0x06)
		show_hudmsg(CHR_BOND, L_LIP_014) // "Research records destroyed."
		set_stage_flag(STAGEFLAG_RECORDS_DESTROYED)
		set_ailist(CHR_SELF, GAILIST_IDLE)
		label(0x06)
	endloop(0x04)

	endlist
};

u8 func1003_uplink_doors[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_activated_object(CHR_P1P2, 0x02, /*goto*/ LABEL_2D)
		reloop(0x04)

		label(LABEL_2D)
		if_stage_flag_eq(STAGEFLAG_DOOR_VIRUS_DOWNLOADED, FALSE, /*goto*/ 0x06)
		play_sound(SFX_8116, -1)
		show_hudmsg(CHR_P1P2, L_LIP_048) // "Virus has already been downloaded."
		reloop(0x04)

		label(0x06)
		if_chr_weapon_equipped(CHR_P1P2, WEAPON_DATAUPLINK, /*goto*/ LABEL_2D)
		play_sound(SFX_8116, -1)
		show_hudmsg(CHR_P1P2, L_LIP_020) // "Access to door control systems denied."
		reloop(0x04)

		label(LABEL_2D)
		show_hudmsg(CHR_P1P2, L_LIP_030) // "Data Uplink connected."
		restart_timer

		beginloop(0x08)
			if_timer_gt(60, /*goto*/ 0x06)
			if_chr_distance_to_pad_gt(CHR_P1P2, 300, PAD_LIP_0427, /*goto*/ 0x09)
			if_chr_weapon_equipped(CHR_P1P2, WEAPON_DATAUPLINK, /*goto*/ LABEL_2D)
			goto_next(0x09)

			label(LABEL_2D)
		endloop(0x08)

		label(0x06)
		show_hudmsg(CHR_P1P2, L_LIP_049) // "Initiating virus download."
		restart_timer
		assign_sound(SFX_01BF, CHANNEL_5)
		set_object_sound_playing(CHANNEL_5, 0x02, TRUE)

		beginloop(0x11)
			if_timer_gt(400, /*goto*/ 0x06)
			if_chr_distance_to_pad_gt(CHR_P1P2, 300, PAD_LIP_0427, /*goto*/ 0x09)
			if_chr_weapon_equipped(CHR_P1P2, WEAPON_DATAUPLINK, /*goto*/ LABEL_2D)
			goto_next(0x09)

			label(LABEL_2D)
		endloop(0x11)

		label(0x06)
		mute_channel(CHANNEL_5)
		if_object_in_good_condition(0x02, /*goto*/ LABEL_2D)
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(LABEL_2D)
		assign_sound(SFX_01C1, CHANNEL_5)
		set_object_sound_playing(CHANNEL_5, 0x02, TRUE)
		show_hudmsg(CHR_P1P2, L_LIP_023) // "Virus downloaded to console."
		yield
		set_stage_flag(STAGEFLAG_DOOR_VIRUS_DOWNLOADED)
		reloop(0x04)

		label(0x09)
		show_hudmsg(CHR_P1P2, L_LIP_031) // "Data Uplink connection broken."
		mute_channel(CHANNEL_5)
		assign_sound(SFX_01C0, CHANNEL_6)
		set_object_sound_playing(CHANNEL_6, 0x02, TRUE)
		restart_timer

		beginloop(0x13)
			if_timer_gt(120, /*goto*/ 0x06)
		endloop(0x13)

		label(0x06)
		mute_channel(CHANNEL_6)
	endloop(0x04)

	endlist
};

u8 func1004_uplink_lights[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_activated_object(CHR_P1P2, 0x01, /*goto*/ LABEL_2D)
		reloop(0x04)

		label(LABEL_2D)
		if_stage_flag_eq(STAGEFLAG_LIGHT_VIRUS_DONE, FALSE, /*goto*/ 0x06)
		play_sound(SFX_8116, -1)
		show_hudmsg(CHR_P1P2, L_LIP_048) // "Virus has already been downloaded."
		reloop(0x04)

		label(0x06)
		if_chr_weapon_equipped(CHR_P1P2, WEAPON_DATAUPLINK, /*goto*/ LABEL_2D)
		play_sound(SFX_8116, -1)
		show_hudmsg(CHR_P1P2, L_LIP_021) // "Access to light control systems denied."
		reloop(0x04)

		label(LABEL_2D)
		show_hudmsg(CHR_P1P2, L_LIP_030) // "Data Uplink connected."
		restart_timer

		beginloop(0x08)
			if_timer_gt(60, /*goto*/ 0x06)
			if_chr_distance_to_pad_gt(CHR_P1P2, 300, PAD_LIP_0429, /*goto*/ 0x09)
			if_chr_weapon_equipped(CHR_P1P2, WEAPON_DATAUPLINK, /*goto*/ LABEL_2D)
			goto_next(0x09)

			label(LABEL_2D)
		endloop(0x08)

		label(0x06)
		show_hudmsg(CHR_P1P2, L_LIP_049) // "Initiating virus download."
		restart_timer
		assign_sound(SFX_01BF, CHANNEL_5)
		set_object_sound_playing(CHANNEL_5, 0x01, TRUE)

		beginloop(0x11)
			if_timer_gt(400, /*goto*/ 0x06)
			if_chr_distance_to_pad_gt(CHR_P1P2, 300, PAD_LIP_0429, /*goto*/ 0x09)
			if_chr_weapon_equipped(CHR_P1P2, WEAPON_DATAUPLINK, /*goto*/ LABEL_2D)
			goto_next(0x09)

			label(LABEL_2D)
		endloop(0x11)

		label(0x06)
		mute_channel(CHANNEL_5)
		if_object_in_good_condition(0x01, /*goto*/ LABEL_2D)
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(LABEL_2D)
		assign_sound(SFX_01C1, CHANNEL_5)
		set_object_sound_playing(CHANNEL_5, 0x01, TRUE)
		show_hudmsg(CHR_P1P2, L_LIP_023) // "Virus downloaded to console."
		yield
		show_hudmsg(CHR_P1P2, L_LIP_088) // "Lighting systems overloaded."
		configure_environment(0x00c4, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00c3, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00c8, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00c9, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00ca, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00c7, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00c2, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00c1, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00c0, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00bf, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00c6, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00c5, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		configure_environment(0x00a6, AIENVCMD_ROOM_SETFAULTYLIGHTS, 110)
		set_stage_flag(STAGEFLAG_LIGHT_VIRUS_DONE)
		reloop(0x04)

		label(0x09)
		show_hudmsg(CHR_P1P2, L_LIP_031) // "Data Uplink connection broken."
		mute_channel(CHANNEL_5)
		assign_sound(SFX_01C0, CHANNEL_6)
		set_object_sound_playing(CHANNEL_6, 0x01, TRUE)
		restart_timer

		beginloop(0x13)
			if_timer_gt(120, /*goto*/ 0x06)
		endloop(0x13)

		label(0x06)
		mute_channel(CHANNEL_6)
	endloop(0x04)

	endlist
};

u8 func1005_uplink_autoguns[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_activated_object(CHR_P1P2, 0x03, /*goto*/ LABEL_2D)
		reloop(0x04)

		label(LABEL_2D)
		if_stage_flag_eq(STAGEFLAG_LIGHT_VIRUS_DONE, FALSE, /*goto*/ 0x06)
		play_sound(SFX_8116, -1)
		show_hudmsg(CHR_P1P2, L_LIP_048) // "Virus has already been downloaded."
		reloop(0x04)

		label(0x06)
		if_chr_weapon_equipped(CHR_P1P2, WEAPON_DATAUPLINK, /*goto*/ LABEL_2D)
		play_sound(SFX_8116, -1)
		show_hudmsg(CHR_P1P2, L_LIP_022) // "Access to security control systems denied."
		reloop(0x04)

		label(LABEL_2D)
		show_hudmsg(CHR_P1P2, L_LIP_030) // "Data Uplink connected."
		restart_timer

		beginloop(0x08)
			if_timer_gt(60, /*goto*/ 0x06)
			if_chr_distance_to_pad_gt(CHR_P1P2, 300, PAD_LIP_0428, /*goto*/ 0x09)
			if_chr_weapon_equipped(CHR_P1P2, WEAPON_DATAUPLINK, /*goto*/ LABEL_2D)
			goto_next(0x09)

			label(LABEL_2D)
		endloop(0x08)

		label(0x06)
		show_hudmsg(CHR_P1P2, L_LIP_049) // "Initiating virus download."
		restart_timer
		assign_sound(SFX_01BF, CHANNEL_5)
		set_object_sound_playing(CHANNEL_5, 0x03, TRUE)

		beginloop(0x11)
			if_timer_gt(400, /*goto*/ 0x06)
			if_chr_distance_to_pad_gt(CHR_P1P2, 300, PAD_LIP_0428, /*goto*/ 0x09)
			if_chr_weapon_equipped(CHR_P1P2, WEAPON_DATAUPLINK, /*goto*/ LABEL_2D)
			goto_next(0x09)

			label(LABEL_2D)
		endloop(0x11)

		label(0x06)
		mute_channel(CHANNEL_5)
		if_object_in_good_condition(0x03, /*goto*/ LABEL_2D)
		set_ailist(CHR_SELF, GAILIST_IDLE)
		label(LABEL_2D)
		assign_sound(SFX_01C1, CHANNEL_5)
		set_object_sound_playing(CHANNEL_5, 0x00, TRUE)
		show_hudmsg(CHR_P1P2, L_LIP_023) // "Virus downloaded to console."
		yield
		show_hudmsg(CHR_P1P2, L_LIP_105) // "Automatic Defenses Disabled."
		set_stage_flag(STAGEFLAG_AUTOGUN_VIRUS_DONE)
		reloop(0x04)

		label(0x09)
		show_hudmsg(CHR_P1P2, L_LIP_031) // "Data Uplink connection broken."
		mute_channel(CHANNEL_5)
		assign_sound(SFX_01C0, CHANNEL_6)
		set_object_sound_playing(CHANNEL_6, 0x03, TRUE)
		restart_timer

		beginloop(0x13)
			if_timer_gt(120, /*goto*/ 0x06)
		endloop(0x13)

		label(0x06)
		mute_channel(CHANNEL_6)
		reloop(0x04)

		show_hudmsg(CHR_P1P2, L_LIP_023) // "Virus downloaded to console."
		set_stage_flag(STAGEFLAG_AUTOGUN_VIRUS_DONE)
	endloop(0x04)

	endlist
};

u8 func1006_check_lab_accessed[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_in_room(CHR_P1P2, 0x00, 0x008f, /*goto*/ 0x06)
	endloop(0x04)

	label(0x06)
	show_hudmsg(CHR_P1P2, L_LIP_029) // "Laboratory accessed successfully."
	set_stage_flag(STAGEFLAG_ENTERED_LAB)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

#define init_path(accuracy, health, recovery, pathid) \
	set_chr_dodge_rating(2, 10) \
	set_accuracy(accuracy) \
	set_reaction_speed(35) \
	set_chr_maxdamage(CHR_SELF, health) \
	add_health_or_armor(0) \
	set_recovery_speed(recovery) \
	set_shield(0) \
	assign_path(pathid) \
	start_patrol \
	set_ailist(CHR_SELF, GAILIST_UNALERTED_0004)

u8 func0401_start_path00[] = {
	init_path(8, 50, 35, 0x00)
	endlist
};

u8 func0402_start_path01[] = {
	init_path(8, 50, 35, 0x01)
	endlist
};

u8 func0403_start_path02[] = {
	init_path(8, 50, 35, 0x02)
	endlist
};

u8 func0404_start_path03[] = {
	init_path(8, 50, 35, 0x03)
	endlist
};

u8 func0405_start_path04[] = {
	init_path(8, 50, 35, 0x04)
	endlist
};

u8 func0406_start_path05[] = {
	init_path(8, 50, 35, 0x05)
	endlist
};

u8 func0407_start_path06[] = {
	init_path(10, 80, 0, 0x06)
	endlist
};

u8 func0408_start_path07[] = {
	init_path(10, 80, 0, 0x07)
	endlist
};

u8 func0409_start_path08[] = {
	init_path(10, 80, 0, 0x08)
	endlist
};

u8 func040a_start_path09[] = {
	init_path(10, 80, 0, 0x09)
	endlist
};

u8 func040b_start_path10[] = {
	init_path(10, 80, 0, 0x0a)
	endlist
};

u8 func040c_start_path11[] = {
	init_path(10, 80, 0, 0x0b)
	endlist
};

u8 func040d_start_path12[] = {
	init_path(10, 80, 0, 0x0c)
	endlist
};

u8 func040e_start_path13[] = {
	init_path(10, 80, 0, 0x0d)
	endlist
};

u8 func040f_start_path14[] = {
	init_path(10, 80, 0, 0x0e)
	endlist
};

u8 func1001_objectives_failed_msg[] = {
	yield
	set_chr_chrflag(CHR_LABTECH_RECORDS, CHRCFLAG_KEEPCORPSEKO)
	set_chr_chrflag(CHR_LABTECH_LIGHTS, CHRCFLAG_KEEPCORPSEKO)
	set_chr_chrflag(CHR_LABTECH_DOORS1, CHRCFLAG_KEEPCORPSEKO)
	set_chr_chrflag(CHR_LABTECH_SHOWERS, CHRCFLAG_KEEPCORPSEKO)
	set_chr_chrflag(CHR_LABTECH_HARRYSMATE, CHRCFLAG_KEEPCORPSEKO)
	set_chr_chrflag(CHR_LABTECH_KEYCARDGUY, CHRCFLAG_KEEPCORPSEKO)
	set_chr_chrflag(CHR_BIOTECH1, CHRCFLAG_KEEPCORPSEKO)
	set_chr_chrflag(CHR_BIOTECH2, CHRCFLAG_KEEPCORPSEKO)
	set_chr_chrflag(CHR_LABTECH_DOORS2, CHRCFLAG_KEEPCORPSEKO)
	set_chr_chrflag(CHR_MECHANIC, CHRCFLAG_KEEPCORPSEKO)
	set_ailist(CHR_SELF, GAILIST_SHOW_OBJ_FAILED_MSG)
	endlist
};

u8 func0411_labtech_showers_agent[] = {
	beginloop(0x04)
		if_object_in_good_condition(OBJ_WALL, /*goto*/ LABEL_2D)
		goto_next(LABEL_64)

		label(LABEL_2D)
	endloop(0x04)

	beginloop(LABEL_64)
		damage_chr(CHR_SELF, WEAPON_SUPERDRAGON)
		if_chr_dead(CHR_SELF, /*goto*/ LABEL_2D)
	endloop(LABEL_64)

	label(LABEL_2D)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0412_init_labtech_showers[] = {
	if_difficulty_lt(DIFF_SA, /*goto*/ LABEL_2D)
	goto_next(0x06)

	// Agent
	label(LABEL_2D)
	run_to_pad(PAD_LIP_03AB)

	beginloop(0x08)
		if_chr_stopped(/*goto*/ LABEL_2E)
	endloop(0x08)

	label(LABEL_2E)
	set_ailist(CHR_SELF, AILIST_LABTECH_AGENT)

	// SA and PA
	label(0x06)
	set_ailist(CHR_SELF, AILIST_LABTECH_SA_PA)
	endlist
};

u8 func0410_labtech_showers_sa_pa[] = {
	set_shotlist(AILIST_LABTECH_SA_PA)
	if_chr_dead(CHR_SELF, /*goto*/ 0x06)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)

	label(0x06)
	set_shotlist(GAILIST_IDLE)
	set_stage_flag(STAGEFLAG_LABTECH_DEAD)
	restart_timer

	beginloop(LABEL_54)
		if_timer_gt(15, /*goto*/ 0x06)
	endloop(LABEL_54)

	label(0x06)
	say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_shotlist(GAILIST_IDLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(LABEL_2D)
	if_just_injured(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)

	// Injured
	label(0x06)
	restart_timer

	beginloop(LABEL_55)
		if_self_flag_bankx_eq(CHRFLAG0_SAID_INJURY_QUIP, TRUE, BANK_0, /*goto*/ 0x06)
		if_num_times_shot_lt(1, /*goto*/ 0x06)
		if_timer_lt(20, /*goto*/ 0x06)
		say_quip(CHR_BOND, QUIP_INJURED1, 0x28, 0x03, 0x00, BANK_0, 0x00, 0x00)
		say_quip(CHR_BOND, QUIP_INJURED2, 0x28, 0x03, 0x01, BANK_0, 0x00, 0x00)
		set_self_flag_bankx(CHRFLAG0_SAID_INJURY_QUIP, BANK_0)
		label(0x06)
		if_chr_stopped(/*goto*/ LABEL_58)
	endloop(LABEL_55)

	// Not injured, or recovered
	label(LABEL_2D)
	stop_chr

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_can_see_target(/*goto*/ LABEL_2D)
		if_distance_to_target_lt(500, /*goto*/ 0x03)
	endloop(0x04)

	// Detected Jo
	label(LABEL_2D)
	label(0x03)
	if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ LABEL_56)
	restart_timer
	label(0x08)
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x09)

	beginloop(0x09)
		if_target_in_fov_left(10, /*goto*/ 0x06)
		if_timer_gt(60, /*goto*/ 0x06)
	endloop(0x09)

	label(0x06)
	dprint 'T','A','L','K',' ','1','\n',0,
	speak(CHR_TARGET, L_LIP_037, MP3_032D, CHANNEL_4, COLOR_08_RED) // "Who are you?"
	restart_timer
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ LABEL_64)

	// Wait until seeing Jo with a gun, or Jo has clothes
	beginloop(LABEL_64)
		if_timer_lt(120, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
		if_target_aiming_at_me(/*goto*/ LABEL_53)
		label(LABEL_2D)
		if_chr_has_object(CHR_TARGET, OBJ_LABCOAT1, /*goto*/ 0x0d)
		if_chr_has_object(CHR_TARGET, OBJ_LABCOAT2, /*goto*/ 0x0d)
		if_chr_has_object(CHR_TARGET, OBJ_LABCOAT3, /*goto*/ 0x0d)
		if_chr_has_object(CHR_TARGET, OBJ_LABCOAT4, /*goto*/ 0x0d)
		if_chr_has_object(CHR_TARGET, OBJ_LABCOAT5, /*goto*/ 0x0d)
	endloop(LABEL_64)

	// Jo has clothes
	label(0x0d)
	speak(CHR_TARGET, L_LIP_038, MP3_032E, CHANNEL_4, COLOR_08_RED) // "Hey - you've got my clothes."
	restart_timer

	beginloop(0x0e)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
		goto_next(LABEL_53)

		label(LABEL_2D)
		if_timer_gt(180, /*goto*/ 0x06)
	endloop(0x0e)

	label(0x06)
	speak(CHR_TARGET, L_LIP_043, MP3_0332, CHANNEL_4, COLOR_08_RED) // "Give me back my clothes - or else!"
	restart_timer

	beginloop(0x0f)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
		goto_next(LABEL_53)

		label(LABEL_2D)
		if_timer_gt(200, /*goto*/ LABEL_56)
	endloop(0x0f)

	label(LABEL_56)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00aa, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00a9, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00b4, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00b5, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00b6, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00be, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00b7, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00b8, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00b3, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x009b, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00ae, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00af, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00b0, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00b1, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00b2, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00bc, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00ab, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00bb, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00ba, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00b9, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00ac, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00ad, /*goto*/ LABEL_2D)
		goto_next(LABEL_58)

		// Jo is in one of many rooms
		label(LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
		goto_next(LABEL_53)

		// Jo is in one of many rooms with nothing equipped - attack her
		label(LABEL_2D)
		if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ LABEL_2D)
		speak(CHR_TARGET, L_LIP_044, MP3_0333, CHANNEL_4, COLOR_08_RED) // "Right - you've asked for it!"
		set_self_flag_bankx(CHRFLAG0_SKIPSAFETYCHECKS, BANK_0)
		goto_next(0x06)

		label(LABEL_2D)
		call_rng
		if_rand_gt(25, /*goto*/ 0x06)
		speak(CHR_TARGET, L_LIP_045, MP3_0334, CHANNEL_4, COLOR_08_RED) // "Give me my clothes."
		label(0x06)
		try_run_to_target(/*goto*/ LABEL_6F)
		restart_timer

		beginloop(LABEL_6F)
			if_distance_to_target_lt(400, /*goto*/ LABEL_2D)
			if_timer_gt(600, /*goto*/ 0x06)
			if_chr_stopped(/*goto*/ 0x06)
		endloop(LABEL_6F)

		label(LABEL_2D)
		set_returnlist(CHR_SELF, AILIST_LABTECH_SA_PA)
		set_ailist(CHR_SELF, GAILIST_HAND_COMBAT)

		// Chasing Jo for over 10 seconds - do room check again
		label(0x06)
	goto_first(LABEL_56)

	// Jo in an unknown room
	label(LABEL_58)
	goto_next(0x06)

	// Tech saw weapon
	label(LABEL_53)
	chr_do_animation(ANIM_SURPRISED_0202, 0, -1, CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2)
	dprint 'T','A','L','K',' ','1','\n',0,
	speak(CHR_TARGET, L_LIP_041, SFX_8156, CHANNEL_4, COLOR_08_RED) // "Oh, my God - a gun!"
	restart_timer

	beginloop(0x0a)
		if_timer_gt(120, /*goto*/ 0x06)
	endloop(0x0a)

	// Jo in an unknown room, or follow through from seeing weapon
	label(0x06)
	restart_timer
	speak(CHR_TARGET, L_LIP_039, MP3_032F, CHANNEL_4, COLOR_08_RED) // "Help - help!"
	try_set_chrpreset_to_unalerted_teammate(0, /*goto*/ 0x06)

	// No chr in same group - run to pad instead
	run_to_pad(PAD_LIP_0121)

	beginloop(0x10)
		if_chr_stopped(/*goto*/ LABEL_61)
	endloop(0x10)

	label(0x06)
	try_run_to_chr(CHR_PRESET, /*goto*/ 0x0b)

	beginloop(0x0b)
		if_los_to_chr(CHR_PRESET, /*goto*/ LABEL_61)
	endloop(0x0b)

	label(LABEL_61)
	speak(CHR_TARGET, L_LIP_042, MP3_0331, CHANNEL_4, COLOR_08_RED) // "There's an intruder in the complex."
	set_stage_flag(STAGEFLAG_DISGUISE_UNCOVERED)
	increase_squadron_alertness(100)
	stop_chr

	beginloop(0x0c)
	endloop(0x0c)

	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1009_disguise_timer[] = {
	beginloop(0x04)
		// Pointless check
		if_stage_flag_eq(STAGEFLAG_LABTECH_DEAD, TRUE, /*goto*/ LABEL_2D)
		label(LABEL_2D)
		if_chr_has_object(CHR_BOND, OBJ_LABCOAT1, /*goto*/ LABEL_2D)
		if_chr_has_object(CHR_BOND, OBJ_LABCOAT2, /*goto*/ LABEL_2D)
		if_chr_has_object(CHR_BOND, OBJ_LABCOAT3, /*goto*/ LABEL_2D)
		if_chr_has_object(CHR_BOND, OBJ_LABCOAT4, /*goto*/ LABEL_2D)
		if_chr_has_object(CHR_BOND, OBJ_LABCOAT5, /*goto*/ LABEL_2D)
		if_chr_has_object(CHR_COOP, OBJ_LABCOAT1, /*goto*/ LABEL_2D)
		if_chr_has_object(CHR_COOP, OBJ_LABCOAT2, /*goto*/ LABEL_2D)
		if_chr_has_object(CHR_COOP, OBJ_LABCOAT3, /*goto*/ LABEL_2D)
		if_chr_has_object(CHR_COOP, OBJ_LABCOAT4, /*goto*/ LABEL_2D)
		if_chr_has_object(CHR_COOP, OBJ_LABCOAT5, /*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	restart_timer

	beginloop(0x09)
		if_timer_gt(180, /*goto*/ 0x06)
	endloop(0x09)

	label(0x06)
	speak(CHR_BOND, L_LIP_046, MP3_02AB, CHANNEL_4, COLOR_09_BLUE) // "I don't have much time!!!"
	if_difficulty_lt(DIFF_SA, /*goto*/ LABEL_5D)
	if_difficulty_lt(DIFF_PA, /*goto*/ LABEL_5F)
	set_countdown_timer(90)
	goto_next(LABEL_2D)

	label(LABEL_5D)
	set_countdown_timer(180)
	goto_next(LABEL_2D)

	label(LABEL_5F)
	set_countdown_timer(135)
	label(LABEL_2D)
	show_countdown_timer
	start_countdown_timer

	beginloop(0x08)
		if_stage_flag_eq(STAGEFLAG_ENTERED_LAB, TRUE, /*goto*/ LABEL_2D)
		if_countdown_timer_lt(1, /*goto*/ 0x06)
#if VERSION >= VERSION_NTSC_1_0
		if_door_locked(0x4a, 0x40, /*goto*/ LABEL_2E)
		goto_next(0x0d)

		label(LABEL_2E)
#endif
	endloop(0x08)

#if VERSION >= VERSION_NTSC_1_0
	// Door unlocked
	label(0x0d)
#endif

	// Entered lab
	label(LABEL_2D)
	stop_countdown_timer
	hide_countdown_timer
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Timer expired
	label(0x06)
#if VERSION >= VERSION_NTSC_1_0
	stop_countdown_timer
	hide_countdown_timer
	restart_timer
	label(LABEL_66)
	activate_alarm
	yield
	label(LABEL_2D)
#else
	activate_alarm
#endif

	show_hudmsg(CHR_BOND, L_LIP_047) // "The enemy has discovered the disguise."
	set_stage_flag(STAGEFLAG_DISGUISE_UNCOVERED)
	hide_countdown_timer
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func100a_random_doors[] = {
	beginloop(0x04)
		if_stage_flag_eq(STAGEFLAG_DOOR_VIRUS_DOWNLOADED, TRUE, /*goto*/ 0x06)
	endloop(0x04)

	label(0x06)
	set_object_flag(0x07, OBJFLAG_CANNOT_ACTIVATE)
	set_object_flag(0x09, OBJFLAG_CANNOT_ACTIVATE)
	set_object_flag(0x0b, OBJFLAG_CANNOT_ACTIVATE)
	set_object_flag(0x0d, OBJFLAG_CANNOT_ACTIVATE)
	set_object_flag(0x08, OBJFLAG_CANNOT_ACTIVATE)
	set_object_flag(0x0a, OBJFLAG_CANNOT_ACTIVATE)
	set_object_flag(0x0c, OBJFLAG_CANNOT_ACTIVATE)
	set_object_flag(0x0e, OBJFLAG_CANNOT_ACTIVATE)

	beginloop(0x03)
		// 55 in 256 chance of doing anything on a given frame
		call_rng
		if_rand_gt(200, /*goto*/ 0x06)
		reloop(0x03)

		label(0x06)
		call_rng
		if_rand_lt(64, /*goto*/ 0x0a)
		if_rand_lt(128, /*goto*/ 0x0c)
		if_rand_lt(196, /*goto*/ 0x0e)

		// 25% chance //1
		label(0x08)
		if_door_state(0x07, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x09)
		open_door(0x07)
		open_door(0x08)
		reloop(0x03)

		label(0x09)
		close_door(0x07)
		close_door(0x08)
		reloop(0x03)

		// 25% chance //2
		label(0x0a)
		if_door_state(0x09, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x0b)
		open_door(0x09)
		open_door(0x0a)
		reloop(0x03)

		label(0x0b)
		close_door(0x09)
		close_door(0x0a)
		reloop(0x03)

		// 25% chance //3
		label(0x0c)
		if_door_state(0x0b, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x0d)
		open_door(0x0b)
		open_door(0x0c)
		reloop(0x03)

		label(0x0d)
		close_door(0x0b)
		close_door(0x0c)
		reloop(0x03)

		// 25% chance //4
		label(0x0e)
		if_door_state(0x0d, (DOORSTATE_OPEN | DOORSTATE_OPENING), /*goto*/ 0x0f)
		open_door(0x0d)
		open_door(0x0e)
		reloop(0x03)

		label(0x0f)
		close_door(0x0d)
		close_door(0x0e)
	endloop(0x03)

	endlist
};

u8 func0419_init_doorman[] = {
	set_accuracy(10)
	set_reaction_speed(35)
	set_chr_maxdamage(CHR_SELF, 1)
	add_health_or_armor(0)
	set_recovery_speed(0)
	set_shield(0)
	set_ailist(CHR_SELF, AILIST_DOORMAN)
	endlist
};

u8 func0418_doorman[] = {
	set_shotlist(GAILIST_ALERTED)
	if_chr_dead(CHR_SELF, /*goto*/ 0x06)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)

	label(0x06)
	set_shotlist(GAILIST_IDLE)
	restart_timer

	beginloop(LABEL_54)
		if_timer_gt(15, /*goto*/ 0x06)
	endloop(LABEL_54)

	label(0x06)
	say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_shotlist(GAILIST_IDLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Alive
	label(LABEL_2D)
	if_just_injured(CHR_SELF, /*goto*/ 0x06)
	if_has_gun(CHR_SELF, /*goto*/ LABEL_2D)

	// Gun shot out of hand
	label(0x06)
	increase_squadron_alertness(100)
#if VERSION >= VERSION_NTSC_1_0
	set_target_chr(CHR_BOND)
#endif
	set_ailist(CHR_SELF, GAILIST_ALERTED)

	// Waiting for Jo to arrive
	label(LABEL_2D)
	stop_chr

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_can_see_target(/*goto*/ 0x03)
		if_distance_to_target_lt(500, /*goto*/ 0x03)
	endloop(0x04)

	label(0x03)
	restart_timer
	label(0x08)
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x09)

	beginloop(0x09)
		if_target_in_fov_left(10, /*goto*/ 0x06)
		if_timer_gt(60, /*goto*/ 0x06)
	endloop(0x09)

	label(0x06)
	speak(CHR_TARGET, L_LIP_050, SFX_8157, CHANNEL_4, COLOR_08_RED) // "So, you got here at last."

	beginloop(0x0a)
		if_timer_gt(240, /*goto*/ 0x06)
	endloop(0x0a)

	label(0x06)
	if_stage_flag_eq(STAGEFLAG_DISGUISE_UNCOVERED, TRUE, /*goto*/ LABEL_2D)
	if_stage_flag_eq(STAGEFLAG_USED_DISGUISE, TRUE, /*goto*/ 0x06)

	// Disguise not used, or uncovered
	label(LABEL_2D)
	dprint 'T','A','L','K',' ','1','\n',0,
	speak(CHR_TARGET, L_LIP_051, SFX_8158, CHANNEL_4, COLOR_08_RED) // "Hey, you're not... SECURITY ALERT!"
	restart_timer
	stop_chr

	beginloop(0x0b)
		if_timer_lt(120, /*goto*/ LABEL_2D)
	endloop(0x0b)

	label(LABEL_2D)
	set_stage_flag(STAGEFLAG_DOORMAN_REJECTED)
	show_hudmsg(CHR_TARGET, L_LIP_057) // "Cannot gain access to autopsy lab."
	goto_next(LABEL_64)

	// Disguised
	label(0x06)
	if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_59)
	if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_59)

	// Jo has gun equipped
	label(LABEL_2D)
	speak(CHR_TARGET, L_LIP_052, SFX_8159, CHANNEL_4, COLOR_08_RED) // "No guns allowed in here - put your weapon away."
	restart_timer

	beginloop(0x0c)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_59)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_59)
		if_timer_gt(300, /*goto*/ 0x06)
	endloop(0x0c)

	label(0x06)
	speak(CHR_TARGET, L_LIP_053, SFX_815A, CHANNEL_4, COLOR_08_RED) // "I won't tell you again - lose the weapon."
	restart_timer

	beginloop(0x0d)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_59)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_59)
		if_timer_gt(600, /*goto*/ 0x06)
	endloop(0x0d)

#if VERSION >= VERSION_NTSC_1_0
	label(0x1b)
#endif
	label(0x06)
	speak(CHR_TARGET, L_LIP_054, SFX_815B, CHANNEL_4, COLOR_08_RED) // "Right - I'm calling security."
	restart_timer
	label(0x10)
	set_stage_flag(STAGEFLAG_DOORMAN_REJECTED)
	show_hudmsg(CHR_TARGET, L_LIP_057) // "Cannot gain access to autopsy lab."
	goto_next(LABEL_64)

	// Jo disguised and unarmed
	label(LABEL_59)
	speak(CHR_TARGET, L_LIP_055, SFX_815C, CHANNEL_4, COLOR_08_RED) // "Everyone's been waiting for you..."
	restart_timer

	beginloop(0x0e)
		if_timer_gt(120, /*goto*/ 0x06)
	endloop(0x0e)

#if VERSION >= VERSION_NTSC_1_0
	label(0x06)
	if_alarm_active(/*goto*/ LABEL_2D)
	goto_next(0x06)

	label(LABEL_2D)
	goto_first(0x1b)
#endif

	// Unlocking
	label(0x06)
	unset_object_flag2(0x4a, OBJFLAG2_AICANNOTUSE)
	unset_object_flag2(0x4b, OBJFLAG2_AICANNOTUSE)
	unlock_door(0x4a, 0x40)
	unlock_door(0x4b, 0x40)
	open_door(0x4a)
	open_door(0x4b)

	beginloop(0x0f)
		if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x06)
		if_saw_injury(0x00, /*goto*/ 0x06)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
		goto_next(0x06)

		label(LABEL_2D)
		if_door_state(0x4a, (DOORSTATE_CLOSED | DOORSTATE_CLOSING), /*goto*/ LABEL_2D)
		reloop(0x0f)

		label(LABEL_2D)
		open_door(0x4a)
		open_door(0x4b)
	endloop(0x0f)

	label(0x06)
	increase_squadron_alertness(100)
#if VERSION >= VERSION_NTSC_1_0
	set_target_chr(CHR_BOND)
#endif
	set_ailist(CHR_SELF, GAILIST_ALERTED)

	label(LABEL_64)
	yield
	goto_first(LABEL_64)

	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func100b_check_doorman_dead[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_dead(CHR_DOORMAN, /*goto*/ LABEL_2D)
		if_chr_death_animation_finished(CHR_DOORMAN, /*goto*/ LABEL_2D)
		if_chr_knockedout(CHR_DOORMAN, /*goto*/ LABEL_2D)
		reloop(0x04)

		label(LABEL_2D)
		if_chr_has_object(CHR_BOND, 0x06, /*goto*/ 0x0d)
		if_chr_has_object(CHR_COOP, 0x06, /*goto*/ 0x0d)
		if_door_locked(0x4a, 0x40, /*goto*/ LABEL_2D)
		goto_next(0x0d)

		label(LABEL_2D)
		if_chr_in_room(CHR_BOND, 0x00, 0x0083, /*goto*/ 0x06)
		if_chr_in_room(CHR_BOND, 0x00, 0x0084, /*goto*/ 0x06)
		if_chr_in_room(CHR_BOND, 0x00, 0x0085, /*goto*/ 0x06)
		if_chr_in_room(CHR_BOND, 0x00, 0x0086, /*goto*/ 0x06)
		if_chr_in_room(CHR_BOND, 0x00, 0x0087, /*goto*/ 0x06)
		if_chr_in_room(CHR_BOND, 0x00, 0x0088, /*goto*/ 0x06)
		if_chr_in_room(CHR_BOND, 0x00, 0x0089, /*goto*/ 0x06)
		if_chr_in_room(CHR_BOND, 0x00, 0x008a, /*goto*/ 0x06)
		show_hudmsg(CHR_P1P2, L_LIP_056) // "Critical mission personnel killed."
		restart_timer

		beginloop(0x08)
			if_timer_gt(120, /*goto*/ LABEL_2D)
		endloop(0x08)

		label(LABEL_2D)
		show_hudmsg(CHR_P1P2, L_LIP_057) // "Cannot gain access to autopsy lab."
		restart_timer
		set_stage_flag(STAGEFLAG_DOORMAN_DEAD)

		beginloop(0x09)
			if_timer_gt(120, /*goto*/ LABEL_2D)
		endloop(0x09)

		label(LABEL_2D)
		label(0x0d)
		set_ailist(CHR_SELF, GAILIST_IDLE)
		label(0x06)
	endloop(0x04)

	endlist
};

/**
 * The lab guy who stands in the room behind the doorman.
 */
u8 func041a_labtech_harrysmate[] = {
	set_shotlist(AILIST_LABTECH_HARRYSMATE)
	if_chr_dead(CHR_SELF, /*goto*/ 0x06)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)

	label(0x06)
	set_shotlist(GAILIST_IDLE)
	restart_timer

	beginloop(LABEL_54)
		if_timer_gt(15, /*goto*/ 0x06)
	endloop(LABEL_54)

	label(0x06)
	say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_shotlist(GAILIST_IDLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(LABEL_2D)
	if_just_injured(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)

	label(0x06)
	restart_timer

	beginloop(LABEL_55)
		if_self_flag_bankx_eq(CHRFLAG0_SAID_INJURY_QUIP, TRUE, BANK_0, /*goto*/ 0x06)
		if_num_times_shot_lt(1, /*goto*/ 0x06)
		if_timer_lt(20, /*goto*/ 0x06)
		say_quip(CHR_BOND, QUIP_INJURED1, 0x28, 0x03, 0x00, BANK_0, 0x00, 0x00)
		say_quip(CHR_BOND, QUIP_INJURED2, 0x28, 0x03, 0x01, BANK_0, 0x00, 0x00)
		set_self_flag_bankx(CHRFLAG0_SAID_INJURY_QUIP, BANK_0)
		label(0x06)
		if_chr_stopped(/*goto*/ LABEL_58)
	endloop(LABEL_55)

	label(LABEL_58)
	goto_next(LABEL_5A)

	label(LABEL_2D)
	stop_chr

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0083, /*goto*/ 0x08)
	endloop(0x04)

	beginloop(0x08)
		if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ LABEL_2D)
		if_can_see_target(/*goto*/ LABEL_2D)
		if_distance_to_target_lt(500, /*goto*/ LABEL_2D)
	endloop(0x08)

	label(LABEL_2D)
	restart_timer
	label(0x08)
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x09)

	beginloop(0x09)
		if_target_in_fov_left(10, /*goto*/ 0x06)
		if_timer_gt(60, /*goto*/ 0x06)
	endloop(0x09)

	label(0x06)
	speak(CHR_TARGET, L_LIP_058, MP3_02BB, CHANNEL_4, COLOR_08_RED) // "Hey, that's not Harry. It's an intruder."
	increase_squadron_alertness(120)
	restart_timer
	chr_do_animation(ANIM_SURRENDER_002E, 0, -1, CHRANIMFLAG_COMPLETED | CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2)

	beginloop(0x0a)
		if_timer_gt(120, /*goto*/ 0x06)
	endloop(0x0a)

	label(0x06)
	run_to_pad(PAD_LIP_011E)

	beginloop(0x0b)
		if_chr_stopped(/*goto*/ LABEL_5A)
	endloop(0x0b)

	label(LABEL_5A)
	chr_do_animation(ANIM_DRAW_PISTOL_0288, 0, -1, 0, 16, CHR_SELF, 2)

	beginloop(0x0c)
		if_chr_stopped(/*goto*/ 0x06)
	endloop(0x0c)

	label(0x06)
	dprint 'C','R','E','A','T','E','D',' ','W','E','A','P','\n',0,
	try_equip_weapon(MODEL_CHRDRUGGUN, WEAPON_TRANQUILIZER, 0x10000000, /*goto*/ 0x06)
	label(0x06)
#if VERSION >= VERSION_NTSC_1_0
	set_target_chr(CHR_BOND)
#endif
	set_ailist(CHR_SELF, GAILIST_ALERTED)
	endlist
};

u8 func041b_labtech_keycardguy[] = {
	set_shotlist(AILIST_LABTECH_KEYCARDGUY)
	if_chr_dead(CHR_SELF, /*goto*/ 0x06)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)

	// Dying
	label(0x06)
	set_shotlist(GAILIST_IDLE)
	restart_timer

	beginloop(LABEL_54)
		if_timer_gt(15, /*goto*/ 0x06)
	endloop(LABEL_54)

	label(0x06)
	say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_shotlist(GAILIST_IDLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Alive
	label(LABEL_2D)
	if_just_injured(CHR_SELF, /*goto*/ 0x06)
	goto_next(0x08)

	// Injured
	label(0x06)
	restart_timer

	beginloop(LABEL_55)
		if_self_flag_bankx_eq(CHRFLAG0_SAID_INJURY_QUIP, TRUE, BANK_0, /*goto*/ 0x06)
		if_num_times_shot_lt(1, /*goto*/ 0x06)
		if_timer_lt(20, /*goto*/ 0x06)
		say_quip(CHR_BOND, QUIP_INJURED1, 0x28, 0x03, 0x00, BANK_0, 0x00, 0x00)
		say_quip(CHR_BOND, QUIP_INJURED2, 0x28, 0x03, 0x01, BANK_0, 0x00, 0x00)
		set_self_flag_bankx(CHRFLAG0_SAID_INJURY_QUIP, BANK_0)
		label(0x06)
		if_chr_stopped(/*goto*/ LABEL_58)
	endloop(LABEL_55)

	label(LABEL_58)
	goto_next(LABEL_5A)

	// Not injured, or recovered
	// Waiting to detect Jo
	beginloop(0x08)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_can_see_target(/*goto*/ LABEL_2D)
		if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ LABEL_2D)
	endloop(0x08)

	// Detected
	label(LABEL_2D)
	jog_to_pad(PAD_LIP_011B)

	beginloop(0x08)
		if_chr_distance_to_pad_lt(CHR_SELF, 100, PAD_LIP_011B, /*goto*/ LABEL_2D)
	endloop(0x08)

	label(LABEL_2D)
	restart_timer
	chr_do_animation(ANIM_SURRENDER_002E, 0, 190, CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2)

	beginloop(0x09)
		if_timer_gt(60, /*goto*/ 0x06)
		reloop(0x09)

		label(0x06)
		set_stage_flag(STAGEFLAG_KEYCARDGUY_ANGRY)
		if_chr_stopped(/*goto*/ LABEL_5A)
	endloop(0x09)

	label(LABEL_5A)
	chr_do_animation(ANIM_DRAW_PISTOL_0288, 0, -1, 0, 16, CHR_SELF, 2)

	beginloop(0x0a)
		if_chr_stopped(/*goto*/ 0x06)
	endloop(0x0a)

	label(0x06)
	dprint 'C','R','E','A','T','E','D',' ','W','E','A','P','\n',0,
	try_equip_weapon(MODEL_CHRDRUGGUN, WEAPON_TRANQUILIZER, 0x10000000, /*goto*/ 0x06)
	label(0x06)
#if VERSION >= VERSION_NTSC_1_0
	set_target_chr(CHR_BOND)
#endif
	set_ailist(CHR_SELF, GAILIST_ALERTED)
	endlist
};

u8 func100c_keycardguy_lights[] = {
	set_lights_state(0x0088, LIGHTOP_SET, 0, 0, 0)

	beginloop(0x04)
		if_stage_flag_eq(STAGEFLAG_KEYCARDGUY_ANGRY, TRUE, /*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	set_lights_state(0x0088, LIGHTOP_SET, 100, 0, 0)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func100d_check_entered_lab[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0083, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0084, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0085, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0086, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0087, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0088, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0089, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x008a, /*goto*/ 0x06)
	endloop(0x04)

	label(0x06)
	set_stage_flag(STAGEFLAG_ENTERED_LAB)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func100e_elvis_timer[] = {
	beginloop(0x04)
		if_door_state(0x13, (DOORSTATE_OPEN | DOORSTATE_CLOSING | DOORSTATE_OPENING), /*goto*/ 0x06)
	endloop(0x04)

	label(0x06)
	set_stage_flag(STAGEFLAG_ENTERED_ELVIS_AREA)
	play_x_track(XREASON_DEFAULT, 10, 60)
	set_countdown_timer(60)
	show_countdown_timer
	start_countdown_timer

	beginloop(0x08)
		if_stage_flag_eq(STAGEFLAG_RESCUED_ELVIS, TRUE, /*goto*/ LABEL_2D)
		if_countdown_timer_lt(1, /*goto*/ 0x06)
	endloop(0x08)

	label(0x06)
	stop_countdown_timer
	hide_countdown_timer
	set_stage_flag(STAGEFLAG_ELVIS_DEAD)
	show_hudmsg(CHR_BOND, L_LIP_064) // "Elvis has been killed."
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(LABEL_2D)
	stop_countdown_timer
	hide_countdown_timer
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func100f_check_end_level[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_distance_to_pad_lt(CHR_P1P2, 300, PAD_LIP_02A1, /*goto*/ 0x06)
		reloop(0x04)

		label(0x06)
		set_stage_flag(STAGEFLAG_RESCUED_ELVIS)
		yield
		yield
		if_all_objectives_complete(/*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	set_invincible(CHR_BOND)
	revoke_control(CHR_BOND, 4)
	hide_countdown_timer
	stop_countdown_timer
	restart_timer

	beginloop(LABEL_5C)
		if_chr_death_animation_finished(CHR_BOND, /*goto*/ LABEL_2D)
		if_chr_dead(CHR_BOND, /*goto*/ LABEL_2D)
		if_chr_knockedout(CHR_BOND, /*goto*/ LABEL_2D)
		goto_next(0x06)

		label(LABEL_2D)
		if_chr_death_animation_finished(CHR_COOP, /*goto*/ LABEL_2D)
		if_chr_dead(CHR_COOP, /*goto*/ LABEL_2D)
		if_chr_knockedout(CHR_COOP, /*goto*/ LABEL_2D)
		goto_next(0x06)

		label(LABEL_2D)
		end_level
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(0x06)
		set_ailist(CHR_SELF, AILIST_OUTRO)
		if_timer_gt(280, /*goto*/ LABEL_5B)
	endloop(LABEL_5C)

	label(LABEL_5B)
	end_level
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1010_give_keycard[] = {
	set_chr_chrflag(0x23, CHRCFLAG_KILLCOUNTABLE)
	set_chr_chrflag(0x24, CHRCFLAG_KILLCOUNTABLE)
	set_chr_chrflag(0x25, CHRCFLAG_KILLCOUNTABLE)
	set_chr_chrflag(0x26, CHRCFLAG_KILLCOUNTABLE)

	beginloop(0x04)
		if_stage_flag_eq(STAGEFLAG_ONE_KEYCARD_GUARD_REMAINING, TRUE, /*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	label(LABEL_2D)
	if_chr_dead(0x23, /*goto*/ 0x06)
	if_chr_death_animation_finished(0x23, /*goto*/ 0x06)
	if_chr_knockedout(0x23, /*goto*/ 0x06)
	give_object_to_chr(0x10, 0x23)
	dprint 'G','I','V','E',' ','T','O','4',0,
	goto_next(LABEL_2D)

	label(0x06)
	if_chr_dead(0x24, /*goto*/ 0x06)
	if_chr_death_animation_finished(0x24, /*goto*/ 0x06)
	if_chr_knockedout(0x24, /*goto*/ 0x06)
	give_object_to_chr(0x10, 0x24)
	dprint 'G','I','V','E',' ','T','O','5',0,
	goto_next(LABEL_2D)

	label(0x06)
	if_chr_dead(0x25, /*goto*/ 0x06)
	if_chr_death_animation_finished(0x25, /*goto*/ 0x06)
	if_chr_knockedout(0x25, /*goto*/ 0x06)
	give_object_to_chr(0x10, 0x25)
	dprint 'G','I','V','E',' ','T','O','6',0,
	goto_next(LABEL_2D)

	label(0x06)
	if_chr_death_animation_finished(0x26, /*goto*/ LABEL_2D)
	if_chr_dead(0x26, /*goto*/ LABEL_2D)
	if_chr_knockedout(0x26, /*goto*/ LABEL_2D)
	dprint 'G','I','V','E',' ','T','O','7',0,

	label(LABEL_2D)
	unset_object_flag2(0x10, OBJFLAG2_INVISIBLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0414_init_mechanic[] = {
	set_chr_maxdamage(CHR_SELF, 1)
	set_ailist(CHR_SELF, AILIST_MECHANIC)
	endlist
};

u8 func0413_mechanic[] = {
	set_shotlist(AILIST_MECHANIC)
	if_chr_dead(CHR_SELF, /*goto*/ 0x06)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)

	label(0x06)
	set_shotlist(GAILIST_IDLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	restart_timer

	beginloop(LABEL_54)
		if_timer_gt(15, /*goto*/ 0x06)
	endloop(LABEL_54)

	label(0x06)
	say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_shotlist(GAILIST_IDLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(LABEL_2D)
	if_just_injured(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)

	// Injured
	label(0x06)
	restart_timer

	beginloop(LABEL_55)
		if_self_flag_bankx_eq(CHRFLAG0_SAID_INJURY_QUIP, TRUE, BANK_0, /*goto*/ 0x06)
		if_num_times_shot_lt(1, /*goto*/ 0x06)
		if_timer_lt(20, /*goto*/ 0x06)
		say_quip(CHR_BOND, QUIP_INJURED1, 0x28, 0x03, 0x00, BANK_0, 0x00, 0x00)
		say_quip(CHR_BOND, QUIP_INJURED2, 0x28, 0x03, 0x01, BANK_0, 0x00, 0x00)
		set_self_flag_bankx(CHRFLAG0_SAID_INJURY_QUIP, BANK_0)
		label(0x06)
		if_chr_stopped(/*goto*/ LABEL_58)
	endloop(LABEL_55)

	// Main logic
	label(LABEL_2D)
	stop_chr

	// Wait for player to attempt to open door
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_los_to_target(/*goto*/ 0x0a)
		if_chr_activated_object(CHR_P1P2, 0x14, /*goto*/ LABEL_2D)
		if_chr_activated_object(CHR_P1P2, 0x15, /*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	restart_timer

	beginloop(0x0d)
		if_timer_gt(180, /*goto*/ 0x06)
	endloop(0x0d)

	label(0x06)
	unlock_door(0x14, 0x10)
	unlock_door(0x15, 0x10)
	open_door(0x14)
	open_door(0x15)

	beginloop(0x0a)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_los_to_target(/*goto*/ 0x06)
	endloop(0x0a)

	label(0x06)
	restart_timer

	label(0x08)
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x09)

	beginloop(0x09)
		if_target_in_fov_left(10, /*goto*/ 0x06)
		if_timer_gt(60, /*goto*/ 0x06)
	endloop(0x09)

	label(0x06)
	dprint 'T','A','L','K',' ','1','\n',0,
	speak(CHR_BOND, L_LIP_065, SFX_M0_GET_THE_HELL_OUT_OF_HERE, CHANNEL_4, COLOR_08_RED) // "Get the hell out of here!"
	restart_timer
	chr_do_animation(ANIM_SURRENDER_002E, 0, -1, CHRANIMFLAG_COMPLETED | CHRANIMFLAG_SLOWUPDATE, 16, CHR_SELF, 2)

	beginloop(LABEL_64)
		if_timer_gt(120, /*goto*/ LABEL_2D)
	endloop(LABEL_64)

	label(LABEL_58)
	label(LABEL_2D)
	run_to_pad(PAD_LIP_01BA)

	beginloop(0x0e)
		if_chr_stopped(/*goto*/ 0x06)
	endloop(0x0e)

	label(0x06)
	label(0x0f)
		chr_do_animation(ANIM_COWER_0229, -1, -1, CHRANIMFLAG_SLOWUPDATE, 10, CHR_SELF, 2)

		beginloop(LABEL_8A)
			if_chr_stopped(/*goto*/ LABEL_2D)
		endloop(LABEL_8A)

		label(LABEL_2D)
	goto_first(0x0f)

	endlist
};

u8 func1011_unhide_warehouse_spawner[] = {
	// Wait until player near second elevator
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00f8, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00f7, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00f6, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00f4, /*goto*/ 0x06)
	endloop(0x04)

	// Unhide a guy at the top of the ramp near the start
	label(0x06)
	unset_chr_chrflag(0x44, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x44, CHRCFLAG_INVINCIBLE)
	set_ailist(0x44, AILIST_WAREHOUSE_SPAWNER)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0415_warehouse_spawner[] = {
	set_self_chrflag(CHRCFLAG_CLONEABLE)
	restart_timer

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_los_to_target(/*goto*/ 0x08)
		if_chr_in_room(CHR_TARGET, 0x00, 0x00f8, /*goto*/ 0x08)
		if_chr_in_room(CHR_TARGET, 0x00, 0x00f7, /*goto*/ 0x08)
		if_chr_in_room(CHR_TARGET, 0x00, 0x00f6, /*goto*/ 0x08)
		if_chr_in_room(CHR_TARGET, 0x00, 0x00f4, /*goto*/ 0x08)
		reloop(0x04)

		label(0x08)
		dprint 'H','E','A','R','S','P','A','W','N','\n',0,

		label(LABEL_2D)
		if_never_been_onscreen(/*goto*/ LABEL_4E)
		dprint 'N','E','V','E','R',' ','V','I','S','F','A','I','L','\n',0,
		if_los_to_target(/*goto*/ 0x08)
		reloop(0x04)

		label(0x08)
#if VERSION >= VERSION_NTSC_1_0
		set_target_chr(CHR_BOND)
#endif
		set_ailist(CHR_SELF, GAILIST_ALERTED)

		label(LABEL_4E)
		dprint 'C','H','E','C','K',' ','D','U','P','E','\n',0,
		if_chr_death_animation_finished(CHR_CLONE, /*goto*/ LABEL_4E)
		reloop(0x04)

		label(LABEL_4E)
		dprint 'C','R','E','A','T','E',' ','S','P','A','W','N','\n',0,
		try_spawn_clone2(CHR_SELF, AILIST_WAREHOUSE_CLONE, 0, /*goto*/ LABEL_2D)
		dprint 'C','R','E','A','T','E',' ','F','A','I','L','\n',0,
		reloop(0x04)

		label(LABEL_2D)
		restart_timer
		yield
	endloop(0x04)

	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0417_warehouse_clone[] = {
	set_target_chr(CHR_BOND)
	set_alertness(100)
	try_run_to_target(/*goto*/ LABEL_2D)
	label(LABEL_2D)
	set_returnlist(CHR_SELF, GAILIST_UNALERTED)
	set_ailist(CHR_SELF, GAILIST_UNALERTED)
	endlist
};

u8 func1013_check_chamber_switch_destroyed[] = {
	if_difficulty_lt(DIFF_SA, /*goto*/ 0x0d)

	beginloop(0x04)
		if_object_in_good_condition(OBJ_CHAMBER1_SWITCH, /*goto*/ 0x06)
		if_stage_flag_eq(STAGEFLAG_CHAMBER1_RAISED, TRUE, /*goto*/ LABEL_2D)
		show_hudmsg(CHR_BOND, L_LIP_068) // "Mission critical equipment destroyed."
		set_stage_flag(STAGEFLAG_CHAMBER_SWITCH_DESTROYED)
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(LABEL_2D)
		reloop(0x04)

		label(0x06)
	endloop(0x04)

	label(0x0d)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1014_check_crate_destroyed[] = {
	// The unsetting of the wall's IMMUNE_TO_EXPLOSIVES flag suggests that the
	// wall was originally intended to only be blown up via the crate. This must
	// have been changed at some point, but the unsetting of the flag remains.
	beginloop(0x04)
		if_object_in_good_condition(OBJ_CRATE, /*goto*/ 0x06)
		unset_object_flag(OBJ_WALL, OBJFLAG_INVINCIBLE)
		yield
		yield
		yield
		yield
		yield
		yield
		yield
		yield
		yield
		yield
		if_object_in_good_condition(OBJ_WALL, /*goto*/ LABEL_2D)
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(LABEL_2D)
		show_hudmsg(CHR_BOND, L_LIP_068) // "Mission critical equipment destroyed."
		set_stage_flag(STAGEFLAG_CRATE_DESTROYED)

		beginloop(0x08)
			if_object_in_good_condition(OBJ_WALL, /*goto*/ LABEL_2D)
			goto_next(LABEL_2E)

			label(LABEL_2D)
		endloop(0x08)

		label(LABEL_2E)
		unset_stage_flag(STAGEFLAG_CRATE_DESTROYED)
		show_hudmsg(CHR_BOND, L_LIP_089) // "Alternative entrance to medlabs created."
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(0x06)
	endloop(0x04)

	endlist
};

/**
 * @unused
 */
u8 func041c_unused_041c[] = {
	set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

/**
 * @unused
 */
u8 func041d_unused_041d[] = {
	set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

/**
 * @unused
 */
u8 func041e_unused_041e[] = {
	set_chr_dodge_rating(2, 10)
	set_accuracy(10)
	set_reaction_speed(35)
	set_chr_maxdamage(CHR_SELF, 80)
	add_health_or_armor(0)
	set_recovery_speed(0)
	set_shield(0)
	set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE)
	set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1016_check_undisguised[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_stage_flag_eq(STAGEFLAG_DISGUISE_UNCOVERED, TRUE, /*goto*/ 0x06)
		if_chr_dead(CHR_LABTECH_HARRYSMATE, /*goto*/ 0x06)
		if_chr_dead(CHR_LABTECH_KEYCARDGUY, /*goto*/ 0x06)
		if_chr_dead(CHR_DOORMAN, /*goto*/ 0x06)
		if_chr_has_object(CHR_P1P2, OBJ_KEYCARD, /*goto*/ 0x06)
	endloop(0x04)

	label(0x06)
	unset_chr_hiddenflag(CHR_BOND, CHRHFLAG_DISGUISED)
	unset_chr_hiddenflag(CHR_COOP, CHRHFLAG_DISGUISED)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func041f_labtech_lights[] = {
	set_shotlist(AILIST_LABTECH_LIGHTS)
	if_chr_dead(CHR_SELF, /*goto*/ 0x06)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)

	label(0x06)
	restart_timer

	beginloop(LABEL_54)
		if_timer_gt(15, /*goto*/ 0x06)
	endloop(LABEL_54)

	label(0x06)
	say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_shotlist(GAILIST_IDLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(LABEL_2D)
	if_just_injured(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_5E)

	label(0x06)
	set_self_flag_bankx(CHRFLAG0_SKIPSAFETYCHECKS, BANK_0)
	restart_timer

	beginloop(LABEL_55)
		if_self_flag_bankx_eq(CHRFLAG0_SAID_INJURY_QUIP, TRUE, BANK_0, /*goto*/ 0x06)
		if_num_times_shot_lt(1, /*goto*/ 0x06)
		if_timer_lt(20, /*goto*/ 0x06)
		say_quip(CHR_BOND, QUIP_INJURED1, 0x28, 0x03, 0x00, BANK_0, 0x00, 0x00)
		say_quip(CHR_BOND, QUIP_INJURED2, 0x28, 0x03, 0x01, BANK_0, 0x00, 0x00)
		set_self_flag_bankx(CHRFLAG0_SAID_INJURY_QUIP, BANK_0)
		label(0x06)
		if_chr_stopped(/*goto*/ LABEL_5E)
	endloop(LABEL_55)

	label(LABEL_5E)
	if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ LABEL_53)
	call_rng
	if_rand_lt(86, /*goto*/ LABEL_69)
	if_rand_lt(172, /*goto*/ LABEL_6A)
	chr_do_animation(ANIM_SITTING_DORMANT, -1, -1, CHRANIMFLAG_PAUSEATEND | CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(0x04)

	label(LABEL_69)
	chr_do_animation(ANIM_SITTING_DORMANT, -1, -1, CHRANIMFLAG_PAUSEATEND | CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(0x04)

	label(LABEL_6A)
	chr_do_animation(ANIM_SITTING_DORMANT, -1, -1, CHRANIMFLAG_PAUSEATEND | CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(0x04)

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ LABEL_53)
		if_can_see_target(/*goto*/ 0x03)
		if_chr_idle(/*goto*/ 0x06)
		goto_first(LABEL_5E)

		label(0x06)
	endloop(0x04)

	// Jo in sight
	label(0x03)
	object_do_animation(ANIM_025A, 0xff, 0x02, 0xffff)
	dprint 'T','A','L','K',' ','0','\n',0,
	if_self_flag_bankx_eq(CHRFLAG0_SKIPSAFETYCHECKS, TRUE, BANK_0, /*goto*/ LABEL_53)
	restart_timer
	label(0x08)
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x09)

	beginloop(0x09)
		if_target_in_fov_left(10, /*goto*/ 0x06)
		if_timer_gt(60, /*goto*/ 0x06)
	endloop(0x09)

	label(0x06)
	dprint 'T','A','L','K',' ','1','\n',0,
	if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_DISGUISE_UNCOVERED, /*goto*/ 0x06)
	if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_DISGUISED, /*goto*/ LABEL_2D)
	label(0x06)
	object_do_animation(ANIM_025A, 0xff, 0x02, 0xffff)
	speak(CHR_TARGET, L_LIP_037, SFX_SCI_WHO_THE_HELL_ARE_YOU, CHANNEL_4, COLOR_08_RED) // "Who are you?"

#if VERSION >= VERSION_JPN_FINAL
	label(LABEL_68)
	if_sound_finished(CHANNEL_4, /*goto*/ 0x06)
	yield
	goto_first(LABEL_68)

	label(0x06)
#endif

	goto_next(0x06)

	label(LABEL_2D)
	speak(CHR_TARGET, L_LIP_083, MP3_027F, CHANNEL_4, COLOR_08_RED) // "Should you be in here?"
	restart_timer
	do_preset_animation(PRESETANIM_TALKRANDOM)

	beginloop(LABEL_64)
		if_sound_finished(CHANNEL_4, /*goto*/ 0x06)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
		label(LABEL_2D)
	endloop(LABEL_64)

	label(0x06)
	stop_chr
	if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_DISGUISE_UNCOVERED, /*goto*/ 0x06)
	if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_DISGUISED, /*goto*/ 0x0c)
	label(0x06)
	speak(CHR_TARGET, L_LIP_082, MP3_SCI_LEAVE_THIS_AREA, CHANNEL_4, COLOR_08_RED) // "Leave this area now."
	restart_timer
	do_preset_animation(PRESETANIM_TALKRANDOM)

	beginloop(LABEL_66)
		if_sound_finished(CHANNEL_4, /*goto*/ LABEL_53)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
		label(LABEL_2D)
	endloop(LABEL_66)

	label(LABEL_53)
	set_self_flag_bankx(CHRFLAG0_SKIPSAFETYCHECKS, BANK_0)

	label(0x0a)
		set_target_chr(CHR_BOND)
		restart_timer
		try_run_to_target(/*goto*/ 0x0b)

		beginloop(0x0b)
			if_timer_gt(60, /*goto*/ 0x06)
			if_distance_to_target_lt(400, /*goto*/ LABEL_2D)
		endloop(0x0b)

		label(0x06)
	goto_first(0x0a)

	label(LABEL_2D)
	set_self_flag_bankx(CHRFLAG0_GP1, BANK_0)
	set_returnlist(CHR_SELF, AILIST_LABTECH_LIGHTS)
	set_ailist(CHR_SELF, GAILIST_HAND_COMBAT)

	label(0x0c)
	walk_to_pad(PAD_LIP_020D)

	beginloop(0x0d)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_can_see_target(/*goto*/ LABEL_2D)
		if_saw_injury(0x00, /*goto*/ 0x0f)
		label(LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
		goto_next(0x0f)

		label(LABEL_2D)
		if_chr_stopped(/*goto*/ 0x06)
	endloop(0x0d)

	label(0x06)
	set_self_chrflag(CHRCFLAG_CANFACEWALL)
	restart_timer
	try_face_entity(ATTACKFLAG_AIMATPAD, PAD_LIP_0428, /*goto*/ LABEL_6E)

	beginloop(LABEL_6E)
		if_timer_gt(120, /*goto*/ LABEL_6F)
		if_chr_stopped(/*goto*/ LABEL_6F)
	endloop(LABEL_6E)

	label(LABEL_6F)
	call_rng
	if_rand_lt(86, /*goto*/ LABEL_64)
	if_rand_lt(172, /*goto*/ LABEL_66)
	chr_do_animation(ANIM_OPERATE_0221, -1, -1, CHRANIMFLAG_SLOWUPDATE, 10, CHR_SELF, 2)
	goto_next(0x0e)

	label(LABEL_64)
	chr_do_animation(ANIM_OPERATE_0221, -1, -1, CHRANIMFLAG_SLOWUPDATE, 10, CHR_SELF, 2)
	goto_next(0x0e)

	label(LABEL_66)
	chr_do_animation(ANIM_OPERATE_0223, -1, -1, CHRANIMFLAG_SLOWUPDATE, 10, CHR_SELF, 2)

	beginloop(0x0e)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_can_see_target(/*goto*/ LABEL_2D)
		if_saw_injury(0x00, /*goto*/ 0x0f)
		label(LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
		goto_next(0x0f)

		label(LABEL_2D)
		if_chr_idle(/*goto*/ LABEL_2E)
		goto_first(LABEL_6F)

		label(LABEL_2E)
	endloop(0x0e)

	label(0x0f)
	speak(CHR_TARGET, L_LIP_084, SFX_M1_HOLY, CHANNEL_4, COLOR_08_RED) // "Holy..."
	set_self_flag_bankx(CHRFLAG0_SKIPSAFETYCHECKS, BANK_0)
	chr_do_animation(ANIM_SURPRISED_0202, -1, -1, CHRANIMFLAG_PAUSEATEND | CHRANIMFLAG_SLOWUPDATE, 10, CHR_SELF, 2)
	restart_timer

	beginloop(0x10)
		if_timer_gt(60, /*goto*/ LABEL_2D)
	endloop(0x10)

	label(LABEL_2D)
	set_self_flag_bankx(CHRFLAG0_SKIPSAFETYCHECKS, BANK_0)
	goto_first(LABEL_53)

	endlist
};

u8 func0421_init_labtech_doors[] = {
	set_chr_maxdamage(CHR_SELF, 1)
	set_ailist(CHR_SELF, AILIST_LABTECH_DOORS)
	endlist
};

u8 func0420_labtech_doors[] = {
	set_self_chrflag(CHRCFLAG_CANFACEWALL)
	set_shotlist(AILIST_LABTECH_DOORS)
	if_chr_dead(CHR_SELF, /*goto*/ 0x06)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)

	label(0x06)
	say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_shotlist(GAILIST_IDLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(LABEL_2D)
	if_just_injured(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_5E)

	label(0x06)
	restart_timer

	beginloop(LABEL_55)
		if_self_flag_bankx_eq(CHRFLAG0_SAID_INJURY_QUIP, TRUE, BANK_0, /*goto*/ 0x06)
		if_num_times_shot_lt(1, /*goto*/ 0x06)
		if_timer_lt(20, /*goto*/ 0x06)
		say_quip(CHR_BOND, QUIP_INJURED1, 0x28, 0x03, 0x00, BANK_0, 0x00, 0x00)
		say_quip(CHR_BOND, QUIP_INJURED2, 0x28, 0x03, 0x01, BANK_0, 0x00, 0x00)
		set_self_flag_bankx(CHRFLAG0_SAID_INJURY_QUIP, BANK_0)
		label(0x06)
		if_chr_stopped(/*goto*/ LABEL_5E)
	endloop(LABEL_55)

	label(LABEL_5E)
	chr_do_animation(ANIM_OPERATE_0221, -1, -1, CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(LABEL_6F)

	label(LABEL_64)
	chr_do_animation(ANIM_OPERATE_0221, -1, -1, CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(LABEL_6F)

	label(LABEL_66)
	chr_do_animation(ANIM_OPERATE_0223, -1, -1, CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	label(LABEL_6F)

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		set_target_chr(CHR_BOND)
		if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_DISGUISE_UNCOVERED, /*goto*/ 0x06)
		if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_DISGUISED, /*goto*/ LABEL_2D)
		label(0x06)
		goto_next(LABEL_2E)

		label(LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2E)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2E)
		if_self_flag_bankx_eq(CHRFLAG0_COVER_TYPE2, TRUE, BANK_0, /*goto*/ 0x06)
		label(LABEL_2E)
		if_los_to_target(/*goto*/ 0x03)
		label(0x06)
		if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x03)
		if_saw_injury(0x00, /*goto*/ 0x03)
		if_saw_death(0x00, /*goto*/ 0x03)
		if_chr_idle(/*goto*/ LABEL_2D)
		goto_first(LABEL_5E)

		label(LABEL_2D)
	endloop(0x04)

	label(0x03)
	restart_timer
	label(0x08)
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x09)

	beginloop(0x09)
		if_saw_injury(0x00, /*goto*/ LABEL_89)
		if_saw_death(0x00, /*goto*/ LABEL_89)
		if_target_in_fov_left(10, /*goto*/ 0x06)
		if_timer_gt(60, /*goto*/ 0x06)
	endloop(0x09)

	label(0x06)
	dprint 'T','A','L','K',' ','1','\n',0,
	if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_DISGUISE_UNCOVERED, /*goto*/ 0x06)
	if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_DISGUISED, /*goto*/ LABEL_2D)
	label(0x06)
	dprint 'T','A','L','K',' ','2','\n',0,
	goto_next(0x06)

	label(LABEL_2D)
	dprint 'T','A','L','K',' ','3','\n',0,
	if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
	if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
	dprint 'T','A','L','K',' ','4','\n',0,
	goto_next(0x06)

	label(LABEL_2D)
	do_preset_animation(PRESETANIM_TALK3)
	say_quip(CHR_BOND, QUIP_GREETING, 0xff, 0x02, 0xff, BANK_0, 0x00, 0x00)
	set_self_flag_bankx(CHRFLAG0_COVER_TYPE2, BANK_0)

	beginloop(LABEL_7B)
		if_saw_injury(0x00, /*goto*/ LABEL_89)
		if_saw_death(0x00, /*goto*/ LABEL_89)
		dprint 'T','A','L','K',' ','5','\n',0,
		if_chr_not_talking(CHR_SELF, /*goto*/ LABEL_2D)
	endloop(LABEL_7B)

	label(LABEL_2D)
	stop_chr
	goto_first(LABEL_5E)

	label(LABEL_89)
	label(0x06)
	increase_squadron_alertness(100)

	beginloop(LABEL_83)
		if_sound_finished(CHANNEL_4, /*goto*/ LABEL_2D)
	endloop(LABEL_83)

	label(LABEL_2D)
	if_self_flag_bankx_eq(CHRFLAG0_GP1, TRUE, BANK_0, /*goto*/ LABEL_2E)
	speak(CHR_BOND, L_LIP_085, MP3_M0_ITS_A_SPY, CHANNEL_4, COLOR_08_RED) // "It's a spy!"
	goto_next(LABEL_2D)

	label(LABEL_2E)
	speak(CHR_BOND, L_LIP_087, MP3_M0_IMPOSTER, CHANNEL_4, COLOR_08_RED) // "Imposter!"
	label(LABEL_2D)
	label(0x06)
	go_to_target_pad(GOPOSFLAG_JOG)

	beginloop(0x0a)
		if_chr_stopped(/*goto*/ 0x06)
	endloop(0x0a)

	label(0x06)
	restart_timer
	if_self_flag_bankx_eq(CHRFLAG0_GP1, TRUE, BANK_0, /*goto*/ LABEL_2D)
	try_face_entity(ATTACKFLAG_AIMATPAD, PAD_LIP_03C6, /*goto*/ LABEL_70)
	label(LABEL_2D)
	try_face_entity(ATTACKFLAG_AIMATPAD, PAD_LIP_03C7, /*goto*/ LABEL_70)

	beginloop(LABEL_70)
		if_timer_gt(30, /*goto*/ LABEL_2D)
	endloop(LABEL_70)

	label(LABEL_2D)
	chr_do_animation(ANIM_OPERATE_0221, -1, 120, CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	restart_timer

	beginloop(LABEL_71)
		if_timer_gt(120, /*goto*/ LABEL_2D)
		if_timer_lt(60, /*goto*/ LABEL_2D)
		if_stage_flag_eq(STAGEFLAG_AUTOGUN_ACTIVATED, TRUE, /*goto*/ 0x06)
		if_stage_flag_eq(STAGEFLAG_AUTOGUN_VIRUS_DONE, TRUE, /*goto*/ LABEL_2D)
		set_stage_flag(STAGEFLAG_AUTOGUN_ACTIVATED)
		if_self_flag_bankx_eq(CHRFLAG0_GP1, TRUE, BANK_0, /*goto*/ LABEL_75)
		assign_sound(SFX_043A, CHANNEL_7)
		set_object_sound_playing(CHANNEL_7, 0x3c, TRUE)
		goto_next(LABEL_2D)

		label(LABEL_75)
		assign_sound(SFX_043A, CHANNEL_7)
		set_object_sound_playing(CHANNEL_7, 0x3d, TRUE)
		label(LABEL_2D)
	endloop(LABEL_71)

	label(0x06)
	restart_timer
	try_face_entity(ATTACKFLAG_AIMATPAD, PAD_LIP_0107, /*goto*/ LABEL_73)

	beginloop(LABEL_73)
		if_timer_gt(30, /*goto*/ 0x06)
	endloop(LABEL_73)

	label(0x06)
	dprint 'F','L','A','G',' ','S','E','T','\n',0,
	label(0x10)
	chr_do_animation(ANIM_COWER_0229, -1, -1, CHRANIMFLAG_SLOWUPDATE, 10, CHR_SELF, 2)

	beginloop(LABEL_77)
		if_chr_stopped(/*goto*/ LABEL_2D)
	endloop(LABEL_77)

	label(LABEL_2D)
	goto_first(0x10)

	endlist
};

u8 func1017_activate_autogun[] = {
	set_object_flag(OBJ_AUTOGUN, OBJFLAG_DEACTIVATED)

	beginloop(0x04)
		if_stage_flag_eq(STAGEFLAG_AUTOGUN_ACTIVATED, TRUE, /*goto*/ 0x06)
	endloop(0x04)

	label(0x06)
	if_object_in_good_condition(OBJ_AUTOGUN, /*goto*/ LABEL_2D)
	goto_next(0x06)

	label(LABEL_2D)
	unset_object_flag(OBJ_AUTOGUN, OBJFLAG_DEACTIVATED)
	label(0x06)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0423_init_labtech_records[] = {
	set_chr_maxdamage(CHR_SELF, 1)
	set_ailist(CHR_SELF, AILIST_LABTECH_RECORDS)
	endlist
};

u8 func0422_labtech_records[] = {
	set_shotlist(AILIST_LABTECH_RECORDS)
	if_chr_dead(CHR_SELF, /*goto*/ 0x06)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x06)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_2D)
	label(0x06)
	set_shotlist(GAILIST_IDLE)
	restart_timer
	label(LABEL_54)
	yield
	if_timer_gt(15, /*goto*/ 0x06)
	goto_first(LABEL_54)

	label(0x06)
	say_quip(CHR_BOND, QUIP_DIE, 0xff, 0x03, 0xff, BANK_0, 0x00, 0x00)
	set_shotlist(GAILIST_IDLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	label(LABEL_2D)
	if_just_injured(CHR_SELF, /*goto*/ 0x06)
	goto_next(LABEL_5E)
	label(0x06)
	restart_timer
	label(LABEL_55)
	yield
	if_self_flag_bankx_eq(CHRFLAG0_SAID_INJURY_QUIP, TRUE, BANK_0, /*goto*/ 0x06)
	if_num_times_shot_lt(1, /*goto*/ 0x06)
	if_timer_lt(20, /*goto*/ 0x06)
	say_quip(CHR_BOND, QUIP_INJURED1, 0x28, 0x03, 0x00, BANK_0, 0x00, 0x00)
	say_quip(CHR_BOND, QUIP_INJURED2, 0x28, 0x03, 0x01, BANK_0, 0x00, 0x00)
	set_self_flag_bankx(CHRFLAG0_SAID_INJURY_QUIP, BANK_0)
	label(0x06)
	if_chr_stopped(/*goto*/ LABEL_5E)
	goto_first(LABEL_55)

	label(LABEL_5E)
	call_rng
	if_rand_lt(32, /*goto*/ LABEL_64)
	if_rand_lt(64, /*goto*/ LABEL_66)
	if_rand_lt(96, /*goto*/ LABEL_68)
	if_rand_lt(128, /*goto*/ LABEL_69)
	if_rand_lt(160, /*goto*/ LABEL_6A)
	if_rand_lt(192, /*goto*/ LABEL_6B)
	if_rand_lt(224, /*goto*/ LABEL_6C)
	chr_do_animation(ANIM_OPERATE_0221, -1, -1, CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(0x04)
	label(LABEL_64)
	chr_do_animation(ANIM_OPERATE_0221, -1, -1, CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(0x04)
	label(LABEL_66)
	chr_do_animation(ANIM_OPERATE_0223, -1, -1, CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(0x04)
	label(LABEL_68)
	chr_do_animation(ANIM_OPERATE_0221, -1, -1, CHRANIMFLAG_FLIP | CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(0x04)
	label(LABEL_69)
	chr_do_animation(ANIM_OPERATE_0221, -1, -1, CHRANIMFLAG_FLIP | CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(0x04)
	label(LABEL_6A)
	chr_do_animation(ANIM_OPERATE_0223, -1, -1, CHRANIMFLAG_FLIP | CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(0x04)
	label(LABEL_6B)
	chr_do_animation(ANIM_023A, -1, -1, CHRANIMFLAG_FLIP | CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)
	goto_next(0x04)
	label(LABEL_6C)
	chr_do_animation(ANIM_HEAD_ROLL, -1, -1, CHRANIMFLAG_FLIP | CHRANIMFLAG_SLOWUPDATE, 1, CHR_SELF, 2)

	beginloop(0x04)
		if_chr_idle(/*goto*/ LABEL_2D)
		goto_first(LABEL_5E)

		label(LABEL_2D)
		chr_toggle_p1p2(CHR_SELF)
		set_target_chr(CHR_P1P2)
		if_can_see_target(/*goto*/ 0x03)
		if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ 0x03)
		if_distance_to_target_lt(500, /*goto*/ 0x03)
		reloop(0x04)

		label(0x03)
		if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_DISGUISE_UNCOVERED, /*goto*/ 0x06)
		if_chr_has_hiddenflag(CHR_TARGET, CHRHFLAG_DISGUISED, /*goto*/ LABEL_2D)
		goto_next(0x06)

		label(LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_NONE, /*goto*/ LABEL_2D)
		if_chr_weapon_equipped(CHR_TARGET, WEAPON_UNARMED, /*goto*/ LABEL_2D)
		goto_next(0x06)

		label(LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	restart_timer
	label(0x08)
	try_face_entity(ATTACKFLAG_AIMATTARGET, 0, /*goto*/ 0x09)

	beginloop(0x09)
		if_target_in_fov_left(10, /*goto*/ 0x06)
		if_timer_gt(60, /*goto*/ 0x06)
	endloop(0x09)

	label(0x06)
	label(0x06)
	if_alertness(99, OPERATOR_GREATER_THAN, /*goto*/ LABEL_2D)
	increase_squadron_alertness(100)
	speak(CHR_TARGET, L_LIP_087, MP3_M0_IMPOSTER, CHANNEL_4, COLOR_08_RED) // "Imposter!"
	chr_do_animation(ANIM_SURPRISED_0202, -1, -1, CHRANIMFLAG_PAUSEATEND | CHRANIMFLAG_SLOWUPDATE, 10, CHR_SELF, 2)
	restart_timer

	beginloop(LABEL_79)
		if_timer_gt(90, /*goto*/ LABEL_2D)
	endloop(LABEL_79)

	label(LABEL_2D)
	dprint 'T','A','L','K',' ','1','\n',0,
	speak(CHR_TARGET, L_LIP_086, SFX_M1_WARN_THE_OTHERS, CHANNEL_4, COLOR_08_RED) // "Warn the others..."
	label(LABEL_2D)
	label(0x06)
	run_to_pad(PAD_LIP_0108)

	beginloop(0x0a)
		if_chr_stopped(/*goto*/ 0x06)
	endloop(0x0a)

	label(0x06)
	dprint 'F','L','A','G',' ','S','E','T','\n',0,
	label(0x10)
	chr_do_animation(ANIM_COWER_0229, -1, -1, CHRANIMFLAG_SLOWUPDATE, 10, CHR_SELF, 2)

	beginloop(0x0e)
		if_chr_stopped(/*goto*/ LABEL_2D)
	endloop(0x0e)

	label(LABEL_2D)
	goto_first(0x10)

	endlist
};

/**
 * Chambers are actually lifts. They must be disabled so they don't continuously
 * go up and down.
 */
u8 func1018_disable_chambers[] = {
	set_object_flag(OBJ_CHAMBER1, OBJFLAG_DEACTIVATED)
	set_object_flag(OBJ_CHAMBER2, OBJFLAG_DEACTIVATED)
	set_object_flag(OBJ_CHAMBER3, OBJFLAG_DEACTIVATED)
	set_object_flag(OBJ_CHAMBER4, OBJFLAG_DEACTIVATED)
	set_object_flag(OBJ_CHAMBER5, OBJFLAG_DEACTIVATED)
	set_object_flag(OBJ_CHAMBER6, OBJFLAG_DEACTIVATED)
	set_object_flag(OBJ_CHAMBER7, OBJFLAG_DEACTIVATED)
	set_object_flag(OBJ_CHAMBER8, OBJFLAG_DEACTIVATED)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

// This macro is here is reduce the amount of duplicate code. However, each
// chamber's code is not entirely consistant, hence why it's not used by all
// chambers.
#define chamber_logic(switch, chamber, stageflag) \
	/* Wait for player to activate chamber switch */ \
	beginloop(0x04) \
		chr_toggle_p1p2(CHR_SELF) \
		if_chr_activated_object(CHR_P1P2, switch, /*goto*/ 0x06) \
		reloop(0x04) \
 \
		label(0x06) \
		if_stage_flag_eq(stageflag, TRUE, /*goto*/ LABEL_2D) \
		mute_channel(CHANNEL_0) \
 \
		/* Raising chamber */ \
		assign_sound(SFX_DOOR_042B, CHANNEL_0) \
		set_object_sound_playing(CHANNEL_0, chamber, TRUE) \
		assign_sound(SFX_043A, CHANNEL_7) \
		set_object_sound_playing(CHANNEL_7, switch, TRUE) \
		show_hudmsg(CHR_P1P2, 0x2a42) /* "Containment unit raised up." */ \
		set_object_image(switch, 0, TVCMDLIST_13) \
		unset_object_flag(chamber, OBJFLAG_DEACTIVATED) \
		set_stage_flag(stageflag) \
		restart_timer \
 \
		beginloop(0x08) \
			if_timer_gt(200, /*goto*/ 0x06) \
		endloop(0x08) \
 \
		label(0x06) \
		mute_channel(CHANNEL_0) \
		assign_sound(SFX_DOOR_042C, CHANNEL_0) \
		set_object_sound_playing(CHANNEL_0, chamber, TRUE) \
		set_object_flag(chamber, OBJFLAG_DEACTIVATED) \
		reloop(0x04) \
 \
		/* Lowering chamber */ \
		label(LABEL_2D) \
		mute_channel(CHANNEL_0) \
		assign_sound(SFX_DOOR_042B, CHANNEL_0) \
		set_object_sound_playing(CHANNEL_0, chamber, TRUE) \
		assign_sound(SFX_043A, CHANNEL_7) \
		set_object_sound_playing(CHANNEL_7, switch, TRUE) \
		show_hudmsg(CHR_P1P2, 0x2a43) /* "Containment unit lowered down." */ \
		set_object_image(switch, 0, TVCMDLIST_12) \
		unset_object_flag(chamber, OBJFLAG_DEACTIVATED) \
		unset_stage_flag(stageflag) \
		restart_timer \
 \
		beginloop(0x09) \
			if_timer_gt(200, /*goto*/ 0x06) \
		endloop(0x09) \
 \
		label(0x06) \
		mute_channel(CHANNEL_0) \
		assign_sound(SFX_DOOR_042C, CHANNEL_0) \
		set_object_sound_playing(CHANNEL_0, chamber, TRUE) \
		set_object_flag(chamber, OBJFLAG_DEACTIVATED) \
	endloop(0x04)

/**
 * This chamber has the alien in it.
 */
u8 func1019_chamber1[] = {
	// Wait for player to activate chamber switch
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_activated_object(CHR_P1P2, OBJ_CHAMBER1_SWITCH, /*goto*/ 0x06)
		reloop(0x04)

		label(0x06)
		if_stage_flag_eq(STAGEFLAG_CHAMBER1_RAISED, TRUE, /*goto*/ LABEL_2D)
		mute_channel(CHANNEL_0)

		// Raising chamber
		assign_sound(SFX_DOOR_042B, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER1, TRUE)
		assign_sound(SFX_043A, CHANNEL_7)
		set_object_sound_playing(CHANNEL_7, OBJ_CHAMBER1_SWITCH, TRUE)
		set_object_image(OBJ_CHAMBER1_SWITCH, 0, TVCMDLIST_13)
		show_hudmsg(CHR_P1P2, L_LIP_066) // "Containment unit raised up."
		unset_object_flag(OBJ_CHAMBER1, OBJFLAG_DEACTIVATED)
		set_stage_flag(STAGEFLAG_CHAMBER1_RAISED)
		restart_timer

		beginloop(0x08)
			if_timer_gt(200, /*goto*/ 0x06)
		endloop(0x08)

		label(0x06)
		mute_channel(CHANNEL_0)
		assign_sound(SFX_DOOR_042C, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER1, TRUE)
		set_chr_hiddenflag(CHR_ALIEN, CHRHFLAG_WARPONSCREEN)

		beginloop(LABEL_64)
			chr_move_to_pad(CHR_ALIEN, PAD_LIP_03CA, TRUE, /*goto*/ 0x06)
		endloop(LABEL_64)

		label(0x06)
		yield
		unset_chr_chrflag(CHR_ALIEN, CHRCFLAG_HIDDEN)
		set_ailist(CHR_ALIEN, AILIST_CHECK_LOOKING_AT_ALIEN)
		label(0x06)
		set_object_flag(OBJ_CHAMBER1, OBJFLAG_DEACTIVATED)
		reloop(0x04)

		// Lowering chamber
		label(LABEL_2D)
		mute_channel(CHANNEL_0)
		assign_sound(SFX_DOOR_042B, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER1, TRUE)
		set_chr_chrflag(CHR_ALIEN, CHRCFLAG_HIDDEN)
		assign_sound(SFX_043A, CHANNEL_7)
		set_object_sound_playing(CHANNEL_7, OBJ_CHAMBER1_SWITCH, TRUE)
		set_object_image(OBJ_CHAMBER1_SWITCH, 0, TVCMDLIST_12)
		show_hudmsg(CHR_P1P2, L_LIP_067) // "Containment unit lowered down."
		unset_object_flag(OBJ_CHAMBER1, OBJFLAG_DEACTIVATED)
		unset_stage_flag(STAGEFLAG_CHAMBER1_RAISED)
		restart_timer

		beginloop(0x09)
			if_timer_gt(200, /*goto*/ 0x06)
		endloop(0x09)

		label(0x06)
		mute_channel(CHANNEL_0)
		assign_sound(SFX_DOOR_042C, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER1, TRUE)
		set_object_flag(OBJ_CHAMBER1, OBJFLAG_DEACTIVATED)
	endloop(0x04)
	endlist
};

u8 func101a_chamber2[] = {
	// Wait for player to activate chamber switch
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_activated_object(CHR_P1P2, OBJ_CHAMBER2_SWITCH, /*goto*/ 0x06)
		reloop(0x04)

		label(0x06)
		mute_channel(CHANNEL_0)
		if_stage_flag_eq(STAGEFLAG_CHAMBER2_RAISED, TRUE, /*goto*/ LABEL_2D)

		// Raising chamber
		assign_sound(SFX_DOOR_042B, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER2, TRUE)
		assign_sound(SFX_043A, CHANNEL_7)
		set_object_sound_playing(CHANNEL_7, OBJ_CHAMBER2_SWITCH, TRUE)
		set_object_image(OBJ_CHAMBER2_SWITCH, 0, TVCMDLIST_13)
		show_hudmsg(CHR_P1P2, L_LIP_066) // "Containment unit raised up."
		unset_object_flag(OBJ_CHAMBER2, OBJFLAG_DEACTIVATED)
		set_stage_flag(STAGEFLAG_CHAMBER2_RAISED)
		restart_timer

		beginloop(0x08)
			if_timer_gt(200, /*goto*/ 0x06)
		endloop(0x08)

		label(0x06)
		mute_channel(CHANNEL_0)
		assign_sound(SFX_DOOR_042C, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER2, TRUE)

		set_object_flag(OBJ_CHAMBER2, OBJFLAG_DEACTIVATED)
		reloop(0x04)

		// Lowering chamber
		label(LABEL_2D)
		mute_channel(CHANNEL_0)
		assign_sound(SFX_DOOR_042B, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER2, TRUE)
		assign_sound(SFX_043A, CHANNEL_7)
		set_object_sound_playing(CHANNEL_7, OBJ_CHAMBER2_SWITCH, TRUE)
		set_object_image(OBJ_CHAMBER2_SWITCH, 0, TVCMDLIST_12)
		show_hudmsg(CHR_P1P2, L_LIP_067) // "Containment unit lowered down."
		unset_object_flag(OBJ_CHAMBER2, OBJFLAG_DEACTIVATED)
		unset_stage_flag(STAGEFLAG_CHAMBER2_RAISED)
		restart_timer

		beginloop(0x09)
			if_timer_gt(200, /*goto*/ 0x06)
		endloop(0x09)

		label(0x06)
		mute_channel(CHANNEL_0)
		assign_sound(SFX_DOOR_042C, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER2, TRUE)
		set_object_flag(OBJ_CHAMBER2, OBJFLAG_DEACTIVATED)
	endloop(0x04)
	endlist
};

u8 func101b_chamber3[] = {
	chamber_logic(OBJ_CHAMBER3_SWITCH, OBJ_CHAMBER3, STAGEFLAG_CHAMBER3_RAISED)
	endlist
};

u8 func101c_chamber4[] = {
	chamber_logic(OBJ_CHAMBER4_SWITCH, OBJ_CHAMBER4, STAGEFLAG_CHAMBER4_RAISED)
	endlist
};

u8 func101d_chamber5[] = {
	chamber_logic(OBJ_CHAMBER5_SWITCH, OBJ_CHAMBER5, STAGEFLAG_CHAMBER5_RAISED)
	endlist
};

u8 func101e_chamber6[] = {
	chamber_logic(OBJ_CHAMBER6_SWITCH, OBJ_CHAMBER6, STAGEFLAG_CHAMBER6_RAISED)
	endlist
};

u8 func101f_chamber7[] = {
	chamber_logic(OBJ_CHAMBER7_SWITCH, OBJ_CHAMBER7, STAGEFLAG_CHAMBER7_RAISED)
	endlist
};

u8 func1020_chamber8[] = {
	// Wait for player to activate chamber switch
	beginloop(0x04)
		// Likely @bug: Chamber 8 is the only chamber that doesn't call
		// chr_toggle_p1p2 here.
		// Co-op player might not be able to activate chamber 8.
		if_chr_activated_object(CHR_P1P2, OBJ_CHAMBER8_SWITCH, /*goto*/ 0x06)
		reloop(0x04)

		label(0x06)
		if_stage_flag_eq(STAGEFLAG_CHAMBER8_RAISED, TRUE, /*goto*/ LABEL_2D)
		mute_channel(CHANNEL_0)

		// Raising chamber
		assign_sound(SFX_DOOR_042B, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER8, TRUE)
		assign_sound(SFX_043A, CHANNEL_7)
		set_object_sound_playing(CHANNEL_7, OBJ_CHAMBER8_SWITCH, TRUE)
		show_hudmsg(CHR_P1P2, L_LIP_066) // "Containment unit raised up."
		set_object_image(OBJ_CHAMBER8_SWITCH, 0, TVCMDLIST_13)
		unset_object_flag(OBJ_CHAMBER8, OBJFLAG_DEACTIVATED)
		set_stage_flag(STAGEFLAG_CHAMBER8_RAISED)
		restart_timer

		beginloop(0x08)
			if_timer_gt(200, /*goto*/ 0x06)
		endloop(0x08)

		label(0x06)
		mute_channel(CHANNEL_0)
		assign_sound(SFX_DOOR_042C, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER8, TRUE)

		set_object_flag(OBJ_CHAMBER8, OBJFLAG_DEACTIVATED)
		reloop(0x04)

		// Lowering chamber
		label(LABEL_2D)
		mute_channel(CHANNEL_0)
		assign_sound(SFX_DOOR_042B, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER8, TRUE)

		assign_sound(SFX_043A, CHANNEL_7)
		set_object_sound_playing(CHANNEL_7, OBJ_CHAMBER8_SWITCH, TRUE)
		show_hudmsg(CHR_P1P2, L_LIP_067) // "Containment unit lowered down."
		set_object_image(OBJ_CHAMBER8_SWITCH, 0, TVCMDLIST_12)
		unset_object_flag(OBJ_CHAMBER8, OBJFLAG_DEACTIVATED)
		unset_stage_flag(STAGEFLAG_CHAMBER8_RAISED)
		restart_timer

		beginloop(0x09)
			if_timer_gt(200, /*goto*/ 0x06)
		endloop(0x09)

		label(0x06)
		mute_channel(CHANNEL_0)
		assign_sound(SFX_DOOR_042C, CHANNEL_0)
		set_object_sound_playing(CHANNEL_0, OBJ_CHAMBER8, TRUE)
		set_object_flag(OBJ_CHAMBER8, OBJFLAG_DEACTIVATED)
	endloop(0x04)
	endlist
};

u8 func0424_alien[] = {
	set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE)
	set_ailist(CHR_SELF, AILIST_CHECK_LOOKING_AT_ALIEN)
	endlist
};

/**
 * Guy that's hidden near the start. He starts sending out clones once you reach
 * the second elevator.
 */
u8 func0425_hiddenguy[] = {
	set_chr_chrflag(CHR_SELF, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_SELF, CHRCFLAG_INVINCIBLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0426_check_looking_at_alien[] = {
	beginloop(0x04)
		set_target_chr(CHR_BOND)
		if_self_has_chrflag(CHRCFLAG_HIDDEN, /*goto*/ LABEL_61)
		if_distance_to_target_lt(300, /*goto*/ LABEL_64)
		goto_next(LABEL_66)

		// Jo is in range
		label(LABEL_64)
		if_within_targets_fovx_by_angle(10, /*goto*/ LABEL_2D)

		// Jo is too far away or not looking at alien
		label(LABEL_66)
		set_target_chr(CHR_COOP)
		if_distance_to_target_lt(300, /*goto*/ LABEL_68)
		goto_next(LABEL_69)

		// Velvet is in range
		label(LABEL_68)
		if_within_targets_fovx_by_angle(10, /*goto*/ LABEL_2D)

		// Both players are too far away
		label(LABEL_69)

		// Alien is lowered/hidden
		label(LABEL_61)
		unset_stage_flag(STAGEFLAG_LOOKING_AT_CHAMBER)
		reloop(0x04)

		label(LABEL_2D)
		set_stage_flag(STAGEFLAG_LOOKING_AT_CHAMBER)
	endloop(0x04)

	endlist
};

u8 func1021_xray_scanning[] = {
	beginloop(0x04)
		// @bug? In co-op, the player wearing the xray may be the player who is
		// not looking at the alien.
		chr_toggle_p1p2(CHR_SELF)
		if_player_using_device(CHR_P1P2, WEAPON_XRAYSCANNER, /*goto*/ 0x06)
		reloop(0x04)

		label(0x06)
		if_stage_flag_eq(STAGEFLAG_LOOKING_AT_CHAMBER, TRUE, /*goto*/ 0x06)
		reloop(0x04)

		label(0x06)
		show_hudmsg(CHR_P1P2, L_LIP_074) // "Scanner target acquired."
		restart_timer

		beginloop(0x08)
			if_timer_gt(240, /*goto*/ 0x06)
			if_stage_flag_eq(STAGEFLAG_LOOKING_AT_CHAMBER, FALSE, /*goto*/ LABEL_2D)
		endloop(0x08)

		label(0x06)
		show_hudmsg(CHR_P1P2, L_LIP_075) // "Target ID confirmed - XT origin."
		set_stage_flag(STAGEFLAG_XRAY_DONE)
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(LABEL_2D)
		show_hudmsg(CHR_P1P2, L_LIP_076) // "Scanner lock lost."
	endloop(0x04)

	endlist
};

/**
 * Waits until the player has been in the xray area for over 10 seconds, then
 * spawns a dataDyne shock trooper.
 *
 * Rare may have decided that it was too challenging to have a guard attack you
 * while xraying, hence removed the guard but left this function.
 */
u8 unregistered_function1[] = {
	restart_timer

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_timer_gt(600, /*goto*/ 0x08)
		pause_timer
		if_chr_in_room(CHR_P1P2, 0x00, 0x010d, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0102, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0103, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0104, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0105, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0106, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0107, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0108, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0109, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x010c, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00fa, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00fb, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00fc, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00fd, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00fe, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00ff, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0100, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0101, /*goto*/ 0x06)
		reloop(0x04)

		label(0x06)
		resume_timer
		reloop(0x04)

		// 10 seconds passed
		label(0x08)
		if_chr_death_animation_finished(0x46, /*goto*/ LABEL_2D)
		reloop(0x04)

		label(LABEL_2D)
		try_spawn_chr_at_pad(BODY_DDSHOCK, HEAD_DDSHOCK, PAD_LIP_0101, 0x0427, SPAWNFLAG_BASICGUARD, /*goto*/ 0x06)
		goto_next(LABEL_2D)

		label(0x06)
		restart_timer
		reloop(0x04)

		label(LABEL_2D)
	endloop(0x04)

	endlist
};

/**
 * Assigned by the above, which is an unregistered function.
 *
 * Makes the shock trooper run to one of two xray rooms, depending on which one
 * you're in.
 *
 * @unused
 */
u8 func0427_shock_clone[] = {
	stop_chr
	set_chr_id(0x46)
	set_self_flag_bankx(CHRFLAG0_SKIPSAFETYCHECKS, BANK_0)
	set_self_flag_bankx(CHRFLAG1_NOIDLEANIMS, BANK_1)
	try_equip_weapon(MODEL_CHRSUPERDRAGON, WEAPON_SUPERDRAGON, 0x10000000, /*goto*/ 0x04)

	label(0x04)
	yield
	chr_toggle_p1p2(CHR_SELF)
	if_chr_in_room(CHR_P1P2, 0x00, 0x010d, /*goto*/ 0x06)
	if_chr_in_room(CHR_P1P2, 0x00, 0x0102, /*goto*/ 0x06)
	if_chr_in_room(CHR_P1P2, 0x00, 0x0103, /*goto*/ 0x06)
	if_chr_in_room(CHR_P1P2, 0x00, 0x0104, /*goto*/ 0x06)
	if_chr_in_room(CHR_P1P2, 0x00, 0x0105, /*goto*/ 0x06)
	if_chr_in_room(CHR_P1P2, 0x00, 0x0106, /*goto*/ 0x06)
	if_chr_in_room(CHR_P1P2, 0x00, 0x0107, /*goto*/ 0x06)
	if_chr_in_room(CHR_P1P2, 0x00, 0x0108, /*goto*/ 0x06)
	if_chr_in_room(CHR_P1P2, 0x00, 0x0109, /*goto*/ 0x06)
	run_to_pad(PAD_LIP_0184)
	set_ailist(CHR_SELF, GAILIST_UNALERTED)

	label(0x06)
	run_to_pad(PAD_LIP_013B)
	set_ailist(CHR_SELF, GAILIST_UNALERTED)
	endlist
};

u8 func1023_setup_door_locks[] = {
	if_difficulty_lt(DIFF_SA, /*goto*/ 0x06)
	if_difficulty_lt(DIFF_PA, /*goto*/ 0x09)

	// PA
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Agent - lock big door at bottom of ramp near showers
	label(0x06)
	lock_door(0x44, 0x80)
	lock_door(0x45, 0x80)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// SA - unlock the small shower doors
	label(0x09)
	unlock_door(0x2b, 0x80)
	unlock_door(0x2c, 0x80)
	unlock_door(0x2d, 0x80)
	unlock_door(0x2e, 0x80)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0c01_outro[] = {
	set_invincible(CHR_BOND)
	camera_movement(ANIM_CUT_LIP_OUTRO_CAM)
	play_cutscene_track(MUSIC_RESCUE_OUTRO)
	set_chr_chrflag(CHR_ANTI, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_P1P2_OPPOSITE, CHRCFLAG_HIDDEN)
	set_ailist(CHR_P1P2, GAILIST_IDLE)
	set_ailist(CHR_BIOTECH1, GAILIST_IDLE)
	set_ailist(CHR_BIOTECH2, GAILIST_IDLE)
	set_invincible(CHR_BOND)

	set_chr_chrflag(CHR_P1P2, CHRCFLAG_UNPLAYABLE)
#if VERSION >= VERSION_NTSC_1_0
	unset_chr_chrflag(CHR_P1P2, CHRCFLAG_HIDDEN)
#endif
	set_chr_hiddenflag(CHR_P1P2, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_LIP_OUTRO_JO, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_P1P2, 4)

	set_chr_chrflag(CHR_BIOTECH1, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_BIOTECH1, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_BIOTECH1, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_LIP_OUTRO_BIO1, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_BIOTECH1, 4)

	set_chr_chrflag(CHR_BIOTECH2, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_BIOTECH2, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_BIOTECH2, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_LIP_OUTRO_BIO2, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_BIOTECH2, 4)

	set_object_flag2(0x2f, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(0x2f, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_LIP_OUTRO_BED, 0x2f, 0x04, 0xffff)
	show_nonessential_chrs(FALSE)
	restart_timer
	set_cutscene_weapon(CHR_P1P2, WEAPON_NONE, WEAPON_NONE)
	yield
	set_cutscene_weapon(CHR_P1P2, WEAPON_FALCON2_SCOPE, WEAPON_NONE)

	#define wait_until(time, loopid) \
		beginloop(loopid) \
			if_controller_button_pressed(/*goto*/ LABEL_8B) \
			if_timer_gt(time, /*goto*/ 0x06) \
		endloop(loopid) \
		label(0x06)

	wait_until(315, LABEL_73)
	open_door(0x30)
	open_door(0x31)

	wait_until(344, LABEL_64)
	play_sound(SFX_0161, CHANNEL_CUTSCENE)

	wait_until(380, LABEL_66)
	speak(CHR_P1P2, L_LIP_100, MP3_0433, CHANNEL_7, COLOR_09_BLUE) // "Put your hands up and step away from the alien."

	wait_until(390, LABEL_68)
	play_sound(SFX_0162, CHANNEL_CUTSCENE)

	wait_until(460, LABEL_69)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	wait_until(500, LABEL_74)

	wait_until(514, LABEL_6A)
	play_sound(SFX_0164, CHANNEL_CUTSCENE)

	wait_until(580, LABEL_6C)
	speak(CHR_P1P2, L_LIP_102, MP3_0435, CHANNEL_7, COLOR_09_BLUE) // "Don't make me tell you again, Doctor. And turn tha..."

	wait_until(588, LABEL_6B)
	play_sound(SFX_0161, CHANNEL_CUTSCENE)

	wait_until(606, LABEL_6D)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	wait_until(612, LABEL_6E)
	play_sound(SFX_0164, CHANNEL_CUTSCENE)

	wait_until(618, LABEL_6F)
	play_sound(SFX_0162, CHANNEL_CUTSCENE)

	wait_until(656, LABEL_70)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	wait_until(720, LABEL_71)
	play_sound(SFX_0164, CHANNEL_CUTSCENE)

	wait_until(786, LABEL_72)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	beginloop(0x08)
		if_camera_animating(/*goto*/ LABEL_2D)
		goto_next(LABEL_8B)

		label(LABEL_2D)
		if_controller_button_pressed(/*goto*/ LABEL_8B)
		label(LABEL_2D)
	endloop(0x08)

	label(LABEL_8B)
	mute_channel(CHANNEL_CUTSCENE)
	stop_cutscene_track
	stop_ambient_track
	end_level
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1002_intro[] = {
	set_chr_chrflag(CHR_COOP, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_ANTI, CHRCFLAG_HIDDEN)
	play_cutscene_track(MUSIC_RESCUE_INTRO)
	camera_movement(ANIM_CUT_LIP_INTRO_CAM)
	cmd0175(60)

	set_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE)
	set_chr_hiddenflag(CHR_BOND, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_LIP_INTRO_JO, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_BOND, 4)

	set_chr_chrflag(CHR_JONATHAN, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_JONATHAN, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_JONATHAN, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_LIP_INTRO_JON, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_JONATHAN, 4)

	set_chr_chrflag(CHR_INTRO_DEAD_GUARD, CHRCFLAG_UNPLAYABLE)
	unset_chr_chrflag(CHR_INTRO_DEAD_GUARD, CHRCFLAG_HIDDEN)
	set_chr_hiddenflag(CHR_INTRO_DEAD_GUARD, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_LIP_INTRO_GUARD, -1, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_INTRO_DEAD_GUARD, 4)

	set_object_flag2(OBJ_CRATE, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(OBJ_CRATE, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_LIP_INTRO_CRATE, OBJ_CRATE, 0x04, 0xffff)

	restart_timer
	fade_to_color(0x000000ff, 0)
	fade_to_color(0x00000000, 90)
	set_cutscene_weapon(CHR_BOND, WEAPON_NONE, WEAPON_NONE)
	yield
	set_cutscene_weapon(CHR_BOND, WEAPON_FALCON2_SILENCER, WEAPON_NONE)

	wait_until(62, LABEL_67)
	play_sound(SFX_0161, CHANNEL_CUTSCENE)

	wait_until(90, LABEL_64)
	speak(CHR_BOND, L_LIP_090, MP3_0429, CHANNEL_5, COLOR_03_RED) // "The problem you have is that there is no way to sn..."

	wait_until(108, LABEL_66)
	play_sound(SFX_0162, CHANNEL_CUTSCENE)

	wait_until(686, LABEL_68)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	wait_until(738, LABEL_69)
	play_sound(SFX_0164, CHANNEL_CUTSCENE)

	wait_until(782, LABEL_6A)
	play_sound(SFX_0161, CHANNEL_CUTSCENE)

	wait_until(810, LABEL_6B)
	speak(CHR_BOND, L_LIP_091, MP3_042A, CHANNEL_5, COLOR_09_BLUE) // "Doesn't sound like a problem to me. Where are thes..."

	wait_until(1104, LABEL_6C)
	speak(CHR_BOND, L_LIP_092, MP3_042B, CHANNEL_5, COLOR_03_RED) // "In that crate."

	wait_until(1186, LABEL_6D)
	play_sound(SFX_0162, CHANNEL_CUTSCENE)

	wait_until(1222, LABEL_6E)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	wait_until(1246, LABEL_6F)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	wait_until(1316, LABEL_70)
	play_sound(SFX_01DC, CHANNEL_CUTSCENE)

	wait_until(1346, LABEL_71)
	assign_sound(SFX_8169, CHANNEL_1)
	set_object_sound_playing(CHANNEL_1, OBJ_CRATE, TRUE)

	wait_until(1390, LABEL_72)
	speak(CHR_BOND, L_LIP_093, MP3_042C, CHANNEL_5, COLOR_09_BLUE) // "Cute. Very cute."

	wait_until(1440, LABEL_73)
	play_sound(SFX_0161, CHANNEL_CUTSCENE)

	wait_until(1492, LABEL_74)
	play_sound(SFX_0162, CHANNEL_CUTSCENE)

	wait_until(1584, LABEL_75)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	wait_until(1597, LABEL_76)
	speak(CHR_BOND, L_LIP_094, MP3_042D, CHANNEL_5, COLOR_03_RED) // "By the way, the stores are crawling with guards. I..."

	wait_until(1628, LABEL_77)
	play_sound(SFX_0161, CHANNEL_CUTSCENE)

	wait_until(1658, LABEL_78)
	play_sound(SFX_0162, CHANNEL_CUTSCENE)

	wait_until(1724, LABEL_79)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	wait_until(1792, LABEL_7A)
	play_sound(SFX_0164, CHANNEL_CUTSCENE)

	wait_until(1866, LABEL_7B)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	wait_until(1906, LABEL_7C)
	play_sound(SFX_0161, CHANNEL_CUTSCENE)

	wait_until(2024, LABEL_7D)
	play_sound(SFX_0162, CHANNEL_CUTSCENE)

	wait_until(2017, LABEL_7E)
	speak(CHR_BOND, L_LIP_095, MP3_042E, CHANNEL_5, COLOR_09_BLUE) // "Certainly. Any other pearls of wisdom?"

	wait_until(2275, LABEL_7F)
	speak(CHR_BOND, L_LIP_096, MP3_042F, CHANNEL_5, COLOR_03_RED) // "That crate..."

	wait_until(2338, LABEL_80)
	speak(CHR_BOND, L_LIP_097, MP3_0430, CHANNEL_5, COLOR_09_BLUE) // "Yes?"

	wait_until(2409, LABEL_81)
	speak(CHR_BOND, L_LIP_098, MP3_0431, CHANNEL_5, COLOR_03_RED) // "It really doesn't like being shot."

	wait_until(2440, LABEL_65)
	open_door(0x33)
	open_door(0x34)

	wait_until(2648, LABEL_82)
	play_sound(SFX_0172, CHANNEL_CUTSCENE)

	wait_until(2680, LABEL_83)
	speak(CHR_BOND, L_LIP_099, MP3_0432, CHANNEL_5, COLOR_09_BLUE) // "Great. Now, if I can just fight the urge to report..."

	wait_until(2690, LABEL_84)
	play_sound(SFX_0173, CHANNEL_CUTSCENE)

	wait_until(2986, LABEL_85)
	play_sound(SFX_0161, CHANNEL_CUTSCENE)

	wait_until(3048, LABEL_86)
	play_sound(SFX_0162, CHANNEL_CUTSCENE)

	wait_until(3104, LABEL_87)
	play_sound(SFX_0163, CHANNEL_CUTSCENE)

	wait_until(3152, LABEL_88)
	play_sound(SFX_0164, CHANNEL_CUTSCENE)

	beginloop(0x08)
		if_camera_animating(/*goto*/ LABEL_2D)
		goto_next(LABEL_8B)

		label(LABEL_2D)
		if_controller_button_pressed(/*goto*/ LABEL_8B)
		label(LABEL_2D)
	endloop(0x08)

	label(LABEL_8B)
	mute_channel(CHANNEL_CUTSCENE)
	mute_channel(CHANNEL_5)
	mute_channel(CHANNEL_1)
	assign_sound(SFX_8169, CHANNEL_1)
	set_object_sound_playing(CHANNEL_1, OBJ_CRATE, TRUE)
	unset_chr_chrflag(CHR_BOND, CHRCFLAG_UNPLAYABLE)
	set_chr_hiddenflag(CHR_BOND, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_LIP_INTRO_JO, -2, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_BOND, 2)
	unset_chr_chrflag(CHR_COOP, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(CHR_ANTI, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(CHR_JONATHAN, CHRCFLAG_UNPLAYABLE)
	remove_chr(CHR_JONATHAN)
	unset_chr_chrflag(CHR_INTRO_DEAD_GUARD, CHRCFLAG_UNPLAYABLE)
	set_chr_chrflag(CHR_INTRO_DEAD_GUARD, CHRCFLAG_INVINCIBLE)
	set_chr_hiddenflag(CHR_INTRO_DEAD_GUARD, CHRHFLAG_00020000)
	chr_do_animation(ANIM_CUT_LIP_INTRO_GUARD, -2, -1, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_INTRO_DEAD_GUARD, 2)
	mute_channel(CHANNEL_CUTSCENE)
	unset_object_flag2(OBJ_CRATE, OBJFLAG2_CANFILLVIEWPORT)
	set_object_flag3(OBJ_CRATE, OBJFLAG3_00000010)
	object_do_animation(ANIM_CUT_LIP_INTRO_CRATE, OBJ_CRATE, 0x01, 0xfffe)
	close_door(0x33)
	close_door(0x34)
	stop_cutscene_track
	stop_ambient_track
	enter_firstperson
	yield
	set_chr_chrflag(CHR_INTRO_DEAD_GUARD, CHRCFLAG_PERIMDISABLEDTMP)
	chr_do_animation(ANIM_CUT_LIP_INTRO_GUARD, 2, 3, CHRANIMFLAG_MOVEWHENINVIS | CHRANIMFLAG_PAUSEATEND, 0, CHR_INTRO_DEAD_GUARD, 2)
	set_ailist(CHR_INTRO_DEAD_GUARD, GAILIST_IDLE)
	yield
	kill(CHR_INTRO_DEAD_GUARD)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1024_noop[] = {
	beginloop(0x04)
		if_stage_flag_eq(STAGEFLAG_LIGHT_VIRUS_DONE, TRUE, /*goto*/ 0x03)
	endloop(0x04)

	label(0x03)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

/**
 * Disable chrs, wait until player has keycard, then activate them.
 * Most likely guards in the final corridor.
 */
u8 func1025_toggle_guards[] = {
	set_chr_chrflag(0x33, CHRCFLAG_HIDDEN)
	set_chr_chrflag(0x34, CHRCFLAG_HIDDEN)
	set_chr_chrflag(0x33, CHRCFLAG_INVINCIBLE)
	set_chr_chrflag(0x34, CHRCFLAG_INVINCIBLE)
	set_chr_chrflag(0x37, CHRCFLAG_HIDDEN)
	set_chr_chrflag(0x2c, CHRCFLAG_HIDDEN)
	set_chr_chrflag(0x2d, CHRCFLAG_HIDDEN)
	set_chr_chrflag(0x2e, CHRCFLAG_HIDDEN)
	set_chr_chrflag(0x37, CHRCFLAG_INVINCIBLE)
	set_chr_chrflag(0x2c, CHRCFLAG_INVINCIBLE)
	set_chr_chrflag(0x2d, CHRCFLAG_INVINCIBLE)
	set_chr_chrflag(0x2e, CHRCFLAG_INVINCIBLE)
	set_chr_chrflag(0x2f, CHRCFLAG_HIDDEN)
	set_chr_chrflag(0x30, CHRCFLAG_HIDDEN)
	set_chr_chrflag(0x31, CHRCFLAG_HIDDEN)
	set_chr_chrflag(0x32, CHRCFLAG_HIDDEN)
	set_chr_chrflag(0x2f, CHRCFLAG_INVINCIBLE)
	set_chr_chrflag(0x30, CHRCFLAG_INVINCIBLE)
	set_chr_chrflag(0x31, CHRCFLAG_INVINCIBLE)
	set_chr_chrflag(0x32, CHRCFLAG_INVINCIBLE)

	beginloop(0x08)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_has_object(CHR_P1P2, OBJ_KEYCARD, /*goto*/ LABEL_2D)
	endloop(0x08)

	label(LABEL_2D)
	unset_chr_hiddenflag(CHR_BOND, CHRHFLAG_DISGUISED)
	unset_chr_chrflag(0x33, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x34, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x33, CHRCFLAG_INVINCIBLE)
	unset_chr_chrflag(0x34, CHRCFLAG_INVINCIBLE)
	set_ailist(0x33, AILIST_BIOTECH_GUARD_ALERTED)
	set_ailist(0x34, AILIST_BIOTECH_GUARD_ALERTED)
	unset_chr_chrflag(0x37, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x2c, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x2d, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x2e, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x37, CHRCFLAG_INVINCIBLE)
	unset_chr_chrflag(0x2c, CHRCFLAG_INVINCIBLE)
	unset_chr_chrflag(0x2d, CHRCFLAG_INVINCIBLE)
	unset_chr_chrflag(0x2e, CHRCFLAG_INVINCIBLE)
	set_ailist(0x37, AILIST_SUPERDRAGON_GUARD)
	set_ailist(0x2c, AILIST_SUPERDRAGON_GUARD)
	set_ailist(0x2d, AILIST_SUPERDRAGON_GUARD)
	set_ailist(0x2e, AILIST_SUPERDRAGON_GUARD)
	unset_chr_chrflag(0x2f, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x30, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x31, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x32, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(0x2f, CHRCFLAG_INVINCIBLE)
	unset_chr_chrflag(0x30, CHRCFLAG_INVINCIBLE)
	unset_chr_chrflag(0x31, CHRCFLAG_INVINCIBLE)
	unset_chr_chrflag(0x32, CHRCFLAG_INVINCIBLE)
	set_ailist(0x2f, AILIST_BIOTECH_GUARD)
	set_ailist(0x30, AILIST_SUPERDRAGON_GUARD)
	set_ailist(0x31, AILIST_SUPERDRAGON_GUARD)
	set_ailist(0x32, AILIST_SUPERDRAGON_GUARD)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0429_spawn_while_xraying[] = {
	set_chr_dodge_rating(2, 10)
	set_accuracy(8)
	set_reaction_speed(35)
	set_chr_maxdamage(CHR_SELF, 50)
	add_health_or_armor(0)
	set_recovery_speed(35)
	set_shield(0)
	set_self_chrflag(CHRCFLAG_CLONEABLE)
	set_self_chrflag(CHRCFLAG_HIDDEN)
	set_self_chrflag(CHRCFLAG_INVINCIBLE)
	set_self_chrflag(CHRCFLAG_NEVERSLEEP)
	restart_timer

	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_has_hiddenflag(CHR_P1P2, CHRHFLAG_DISGUISED, /*goto*/ 0x0d)
		if_timer_gt(1800, /*goto*/ LABEL_2D)
		reloop(0x04)

		// 30 seconds passed and not disguised
		label(LABEL_2D)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_has_hiddenflag(CHR_P1P2, CHRHFLAG_DISGUISED, /*goto*/ 0x0d)

		// Xray area
		if_chr_in_room(CHR_P1P2, 0x00, 0x010d, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0102, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0103, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0104, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0105, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0106, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0107, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0108, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0109, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x010c, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00fa, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00fb, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00fc, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00fd, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00fe, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x00ff, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0100, /*goto*/ 0x06)
		if_chr_in_room(CHR_P1P2, 0x00, 0x0101, /*goto*/ 0x06)
		reloop(0x04)

		label(0x06)
		dprint 'O','B','J','E','C','T','I','V','E',' ','D','O','N','E','\n',0,
		label(LABEL_4E)
		if_chr_death_animation_finished(CHR_CLONE, /*goto*/ LABEL_4E)
		reloop(0x04)

		label(LABEL_4E)
		try_spawn_clone2(CHR_SELF, 0x042a, 0, /*goto*/ LABEL_2D)
		label(LABEL_2D)
		restart_timer
		yield
	endloop(0x04)

	label(0x0d)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func042a_init_xray_clone[] = {
	set_self_flag_bankx(CHRFLAG1_NOIDLEANIMS, BANK_1)
	label(0x04)
	rebuild_teams
	rebuild_squadrons
	try_inherit_properties(0x47, /*goto*/ 0x06)
	label(0x06)
	set_ailist(CHR_SELF, 0x042b)
	endlist
};

u8 func042b_xray_clone[] = {
#if VERSION >= VERSION_NTSC_1_0
	set_target_chr(CHR_BOND)
#endif
	set_ailist(CHR_SELF, GAILIST_ALERTED)
	endlist
};

u8 func042c_dragon_guard[] = {
	set_chr_dodge_rating(2, 10)
	set_accuracy(8)
	set_reaction_speed(35)
	set_chr_maxdamage(CHR_SELF, 50)
	add_health_or_armor(0)
	set_recovery_speed(35)
	set_shield(0)
	set_ailist(CHR_SELF, GAILIST_UNALERTED)
	endlist
};

u8 func042d_superdragon_guard[] = {
	set_chr_dodge_rating(2, 10)
	set_accuracy(10)
	set_reaction_speed(35)
	set_chr_maxdamage(CHR_SELF, 80)
	add_health_or_armor(0)
	set_recovery_speed(0)
	set_shield(0)
	set_ailist(CHR_SELF, GAILIST_UNALERTED)
	endlist
};

u8 func042e_biotech_guard[] = {
	set_chr_dodge_rating(2, 10)
	set_accuracy(18)
	set_reaction_speed(35)
	set_chr_maxdamage(CHR_SELF, 80)
	add_health_or_armor(0)
	set_recovery_speed(0)
	set_shield(0)
	set_ailist(CHR_SELF, GAILIST_UNALERTED)
	endlist
};

u8 func042e_biotech_guard_alerted[] = {
	set_chr_dodge_rating(2, 10)
	set_accuracy(18)
	set_reaction_speed(35)
	set_chr_maxdamage(CHR_SELF, 80)
	add_health_or_armor(0)
	set_recovery_speed(0)
	set_shield(0)
#if VERSION >= VERSION_NTSC_1_0
	set_target_chr(CHR_BOND)
#endif
	set_ailist(CHR_SELF, GAILIST_ALERTED)
	endlist
};

u8 func142d_start_lifts[] = {
	activate_lift(1, 0x35)
	activate_lift(4, 0x38)
	activate_lift(5, 0x39)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1027_check_disguise_worn[] = {
	beginloop(0x04)
		if_chr_has_hiddenflag(CHR_BOND, CHRHFLAG_DISGUISED, /*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	show_hudmsg(CHR_BOND, L_LIP_077) // "Disguise has been worn."
	set_returnlist(0x00, 0x0401)
	set_returnlist(0x01, 0x0402)
	set_returnlist(0x02, 0x0403)
	set_returnlist(0x03, 0x0404)
	set_returnlist(0x04, 0x0405)
	set_returnlist(0x05, AILIST_DRAGON_GUARD)
	set_returnlist(0x06, AILIST_DRAGON_GUARD)
	set_returnlist(0x07, AILIST_DRAGON_GUARD)
	set_returnlist(0x08, AILIST_DRAGON_GUARD)
	set_returnlist(0x09, AILIST_DRAGON_GUARD)
	set_returnlist(0x0a, AILIST_DRAGON_GUARD)
	set_returnlist(0x0b, AILIST_DRAGON_GUARD)
	set_returnlist(0x0c, 0x0406)
	set_returnlist(0x0d, 0x0406)
	set_returnlist(0x0e, 0x0406)
	set_returnlist(0x0f, 0x0407)
	set_returnlist(0x10, 0x0408)
	set_returnlist(0x11, AILIST_DRAGON_GUARD)
	set_returnlist(0x27, AILIST_DRAGON_GUARD)
	set_returnlist(0x28, AILIST_DRAGON_GUARD)
	set_returnlist(0x12, AILIST_DRAGON_GUARD)
	set_returnlist(0x13, AILIST_DRAGON_GUARD)
	set_returnlist(0x14, 0x0409)
	set_returnlist(0x15, 0x040a)
	set_returnlist(0x16, AILIST_DRAGON_GUARD)
	set_returnlist(0x17, AILIST_DRAGON_GUARD)
	set_returnlist(0x18, AILIST_DRAGON_GUARD)
	set_returnlist(0x1e, AILIST_DRAGON_GUARD)
	set_returnlist(0x19, AILIST_DRAGON_GUARD)
	set_returnlist(0x1a, AILIST_DRAGON_GUARD)
	set_returnlist(0x1d, AILIST_DRAGON_GUARD)
	set_returnlist(0x1b, 0x040b)
	set_returnlist(0x1c, 0x040c)
	set_returnlist(0x1f, AILIST_DRAGON_GUARD)
	set_returnlist(0x20, AILIST_DRAGON_GUARD)
	set_returnlist(0x21, AILIST_DRAGON_GUARD)
	set_returnlist(0x22, AILIST_DRAGON_GUARD)
	set_ailist(0x00, AILIST_BECOME_UNAWARE)
	set_ailist(0x01, AILIST_BECOME_UNAWARE)
	set_ailist(0x02, AILIST_BECOME_UNAWARE)
	set_ailist(0x03, AILIST_BECOME_UNAWARE)
	set_ailist(0x04, AILIST_BECOME_UNAWARE)
	set_ailist(0x05, AILIST_BECOME_UNAWARE)
	set_ailist(0x06, AILIST_BECOME_UNAWARE)
	set_ailist(0x07, AILIST_BECOME_UNAWARE)
	set_ailist(0x08, AILIST_BECOME_UNAWARE)
	set_ailist(0x09, AILIST_BECOME_UNAWARE)
	set_ailist(0x0a, AILIST_BECOME_UNAWARE)
	set_ailist(0x0b, AILIST_BECOME_UNAWARE)
	set_ailist(0x0c, AILIST_BECOME_UNAWARE)
	set_ailist(0x0d, AILIST_BECOME_UNAWARE)
	set_ailist(0x0e, AILIST_BECOME_UNAWARE)
	set_ailist(0x0f, AILIST_BECOME_UNAWARE)
	set_ailist(0x10, AILIST_BECOME_UNAWARE)
	set_ailist(0x11, AILIST_BECOME_UNAWARE)
	set_ailist(0x27, AILIST_BECOME_UNAWARE)
	set_ailist(0x28, AILIST_BECOME_UNAWARE)
	set_ailist(0x12, AILIST_BECOME_UNAWARE)
	set_ailist(0x13, AILIST_BECOME_UNAWARE)
	set_ailist(0x14, AILIST_BECOME_UNAWARE)
	set_ailist(0x15, AILIST_BECOME_UNAWARE)
	set_ailist(0x16, AILIST_BECOME_UNAWARE)
	set_ailist(0x17, AILIST_BECOME_UNAWARE)
	set_ailist(0x18, AILIST_BECOME_UNAWARE)
	set_ailist(0x1e, AILIST_BECOME_UNAWARE)
	set_ailist(0x19, AILIST_BECOME_UNAWARE)
	set_ailist(0x1a, AILIST_BECOME_UNAWARE)
	set_ailist(0x1d, AILIST_BECOME_UNAWARE)
	set_ailist(0x1b, AILIST_BECOME_UNAWARE)
	set_ailist(0x1c, AILIST_BECOME_UNAWARE)
	set_ailist(0x1f, AILIST_BECOME_UNAWARE)
	set_ailist(0x20, AILIST_BECOME_UNAWARE)
	set_ailist(0x21, AILIST_BECOME_UNAWARE)
	set_ailist(0x22, AILIST_BECOME_UNAWARE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1028_toggle_mechanic[] = {
	if_savefile_flag_is_set(GAMEFILEFLAG_RESCUE_MECHANIC_DEAD, /*goto*/ 0x06)
	dprint 'K','E','E','P',' ','M','E','C','H','\n',0,
	set_ailist(CHR_SELF, GAILIST_IDLE)

	label(0x06)
	dprint 'D','E','L','E','T','E',' ','M','E','C','H','\n',0,
	disable_chr(CHR_MECHANIC)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1029_msg_showers[] = {
	beginloop(0x04)
		if_chr_in_room(CHR_BOND, 0x00, 0x00a9, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_BOND, 0x00, 0x00aa, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_BOND, 0x00, 0x00a9, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_BOND, 0x00, 0x00bc, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_BOND, 0x00, 0x009b, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_BOND, 0x00, 0x00b5, /*goto*/ LABEL_2D)
		if_chr_in_room(CHR_BOND, 0x00, 0x00ad, /*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	speak(CHR_BOND, L_LIP_078, MP3_03BC, CHANNEL_6, COLOR_09_BLUE) // "The showers... Now, if I can convince someone to p..."
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func102a_msg_temperaturedropping[] = {
	restart_timer

	beginloop(0x04)
		if_chr_in_room(CHR_BOND, 0x00, 0x010a, /*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	speak(CHR_BOND, L_LIP_079, SFX_8180, CHANNEL_6, COLOR_09_BLUE) // "The temperature's dropping... You must be close to..."
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func102b_msg_airrecycled[] = {
	beginloop(0x04)
		if_chr_in_room(CHR_BOND, 0x00, 0x007f, /*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	speak(CHR_BOND, L_LIP_080, MP3_03BE, CHANNEL_6, COLOR_09_BLUE) // "The air's heavily recycled around here - must be n..."
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func102c_msg_hurry[] = {
	beginloop(0x04)
		if_chr_in_room(CHR_BOND, 0x00, 0x0093, /*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	speak(CHR_BOND, L_LIP_081, SFX_8181, CHANNEL_6, COLOR_09_BLUE) // "There he is, Jo! Hurry or you'll be too late!"
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

/**
 * This function is run on many guards when Jo puts on the disguise.
 */
u8 func0416_become_unaware[] = {
	set_chr_hiddenflag(CHR_SELF, CHRHFLAG_DONTLOSETARGET)
	if_chr_death_animation_finished(CHR_SELF, /*goto*/ 0x0f)
	if_chr_dead(CHR_SELF, /*goto*/ 0x0f)
	if_chr_knockedout(CHR_SELF, /*goto*/ 0x0f)
	if_los_to_target(/*goto*/ LABEL_2D)
	set_alertness(0)
	return

	label(LABEL_2D)
#if VERSION >= VERSION_NTSC_1_0
	set_target_chr(CHR_BOND)
#endif
	set_ailist(CHR_SELF, GAILIST_ALERTED)

	// Dying/dead
	label(0x0f)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 unregistered_function2[] = {
	set_object_flag(OBJ_WALL, OBJFLAG_INVINCIBLE)

	beginloop(0x04)
		if_object_in_good_condition(OBJ_CRATE, /*goto*/ LABEL_2D)
		goto_next(0x06)

		label(LABEL_2D)
	endloop(0x04)

	// Crate destroyed
	label(0x06)
	unset_object_flag(OBJ_WALL, OBJFLAG_INVINCIBLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func102f_shuffle_disguise[] = {
	yield
	yield
	if_difficulty_lt(DIFF_PA, /*goto*/ 0x0c)
	call_rng
	if_rand_lt(51, /*goto*/ 0x08)
	if_rand_lt(102, /*goto*/ 0x09)
	if_rand_lt(153, /*goto*/ 0x0a)
	if_rand_lt(204, /*goto*/ 0x0b)

	// Rand >= 204 (52 out of 256 chance)
	disable_object(OBJ_LABCOAT1)
	disable_object(OBJ_LABCOAT2)
	disable_object(OBJ_LABCOAT3)
	disable_object(OBJ_LABCOAT4)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Rand < 51 (51 out of 256 chance)
	label(0x08)
	disable_object(OBJ_LABCOAT2)
	disable_object(OBJ_LABCOAT3)
	disable_object(OBJ_LABCOAT4)
	disable_object(OBJ_LABCOAT5)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Rand >= 51 and < 102 (51 out of 256 chance)
	label(0x09)
	disable_object(OBJ_LABCOAT1)
	disable_object(OBJ_LABCOAT3)
	disable_object(OBJ_LABCOAT4)
	disable_object(OBJ_LABCOAT5)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Rand >= 102 and < 153 (51 out of 256 chance)
	label(0x0a)
	disable_object(OBJ_LABCOAT1)
	disable_object(OBJ_LABCOAT2)
	disable_object(OBJ_LABCOAT4)
	disable_object(OBJ_LABCOAT5)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Rand >= 153 and < 204 (51 out of 256 chance)
	label(0x0b)
	disable_object(OBJ_LABCOAT1)
	disable_object(OBJ_LABCOAT2)
	disable_object(OBJ_LABCOAT3)
	disable_object(OBJ_LABCOAT5)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// A and SA
	label(0x0c)
	give_object_to_chr(OBJ_LABCOAT1, CHR_LABTECH_SHOWERS)
	disable_object(OBJ_LABCOAT2)
	disable_object(OBJ_LABCOAT3)
	disable_object(OBJ_LABCOAT4)
	disable_object(OBJ_LABCOAT5)
	set_ailist(CHR_SELF, GAILIST_IDLE)

	// Unreachable
	label(0x0d)
	disable_object(OBJ_LABCOAT1)
	disable_object(OBJ_LABCOAT2)
	disable_object(OBJ_LABCOAT4)
	disable_object(OBJ_LABCOAT5)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1030_lift_door_sounds[] = {
	beginloop(LABEL_5E)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_activated_object(CHR_P1P2, 0x46, /*goto*/ LABEL_2D)
		if_chr_activated_object(CHR_P1P2, 0x47, /*goto*/ LABEL_2D)
		if_chr_activated_object(CHR_P1P2, 0x48, /*goto*/ LABEL_2D)
		if_chr_activated_object(CHR_P1P2, 0x49, /*goto*/ LABEL_2D)
		reloop(LABEL_5E)

		label(LABEL_2D)
		play_sound(SFX_DOOR_81B0, -1)
		restart_timer

		beginloop(0x08)
			if_timer_gt(120, /*goto*/ 0x06)
		endloop(0x08)

		label(0x06)
	endloop(LABEL_5E)

	endlist
};

u8 func1031_toggle_doorman[] = {
	yield
	set_chr_chrflag(CHR_DOORMAN, CHRCFLAG_HIDDEN)
	set_chr_chrflag(CHR_DOORMAN, CHRCFLAG_INVINCIBLE)

	beginloop(LABEL_5E)
		label(LABEL_2D)
		if_difficulty_lt(DIFF_PA, /*goto*/ LABEL_2D)
		if_objective_complete(0, /*goto*/ LABEL_2D)
		goto_first(LABEL_5E)

		label(LABEL_2D)
		if_difficulty_lt(DIFF_SA, /*goto*/ LABEL_2D)
		if_objective_complete(1, /*goto*/ LABEL_2D)
	endloop(LABEL_5E)

	label(LABEL_2D)
	unset_chr_chrflag(CHR_DOORMAN, CHRCFLAG_HIDDEN)
	unset_chr_chrflag(CHR_DOORMAN, CHRCFLAG_INVINCIBLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1032_count_last_room_guards[] = {
	beginloop(0x04)
		set_morale(0)
		if_chr_dead(0x23, /*goto*/ LABEL_2D)
		if_chr_death_animation_finished(0x23, /*goto*/ LABEL_2D)
		if_chr_knockedout(0x23, /*goto*/ LABEL_2D)
		goto_next(0x06)

		label(LABEL_2D)
		add_morale(1)
		label(0x06)
		if_chr_dead(0x24, /*goto*/ LABEL_2D)
		if_chr_death_animation_finished(0x24, /*goto*/ LABEL_2D)
		if_chr_knockedout(0x24, /*goto*/ LABEL_2D)
		goto_next(0x06)

		label(LABEL_2D)
		add_morale(1)
		label(0x06)
		if_chr_dead(0x25, /*goto*/ LABEL_2D)
		if_chr_death_animation_finished(0x25, /*goto*/ LABEL_2D)
		if_chr_knockedout(0x25, /*goto*/ LABEL_2D)
		goto_next(0x06)

		label(LABEL_2D)
		add_morale(1)
		label(0x06)
		if_chr_dead(0x26, /*goto*/ LABEL_2D)
		if_chr_death_animation_finished(0x26, /*goto*/ LABEL_2D)
		if_chr_knockedout(0x26, /*goto*/ LABEL_2D)
		goto_next(0x06)

		label(LABEL_2D)
		add_morale(1)
		label(0x06)
		if_morale_lt(3, /*goto*/ LABEL_2D)
		set_stage_flag(STAGEFLAG_ONE_KEYCARD_GUARD_REMAINING)
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(LABEL_2D)
	endloop(0x04)

	endlist
};

/**
 * When the player uses the disguise the game sets CHRHFLAG_UNTARGETABLE on
 * them. Guards check their targets for this flag periodically and unset their
 * targets if found.
 *
 * This ailist disables the flag after 10 seconds. This causes guards to
 * disengage combat and gives the player an opportunity to leave a combat
 * situation before the guards can become savvy again and foil the disguise.
 */
u8 func1033_unset_untargetable_flag[] = {
	beginloop(0x04)
		chr_toggle_p1p2(CHR_SELF)
		if_chr_has_hiddenflag(CHR_P1P2, CHRHFLAG_UNTARGETABLE, /*goto*/ LABEL_2D)
	endloop(0x04)

	label(LABEL_2D)
	restart_timer

	beginloop(LABEL_64)
		if_timer_gt(600, /*goto*/ LABEL_2D)
	endloop(LABEL_64)

	label(LABEL_2D)
	unset_chr_hiddenflag(CHR_P1P2, CHRHFLAG_UNTARGETABLE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1034_setup_rtracker[] = {
	yield
	set_object_flag3(OBJ_FALCON2SILENCED1, OBJFLAG3_RTRACKED_BLUE)
	set_object_flag3(OBJ_FALCON2SILENCED2, OBJFLAG3_RTRACKED_BLUE)
	set_object_flag3(OBJ_PHOENIX, OBJFLAG3_RTRACKED_BLUE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func1435_setup_environment[] = {
	yield
	configure_environment(0x007c, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x007d, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x007e, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x007f, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0080, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0081, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0082, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0083, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0084, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0085, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0086, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0087, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0088, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0089, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x008a, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x008b, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x008c, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x008d, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x008e, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x008f, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0090, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0091, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0092, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0093, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0094, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0095, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0096, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0097, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0098, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0099, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x009a, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x009b, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00a5, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00a6, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00a7, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00a8, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00a9, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00aa, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00ab, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00ac, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00ad, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00ae, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00af, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00b0, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00b1, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00b3, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00b4, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00b5, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00b6, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00b7, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00b8, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00b9, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00ba, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00bb, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00bc, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00be, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00bf, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00c0, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00c1, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00c2, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00c3, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00c4, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00c5, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00c6, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00c7, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00c8, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00c9, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00ca, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00cb, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00f2, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00fa, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00fb, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00fc, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00fd, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00fe, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x00ff, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0100, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0101, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0102, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0103, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0104, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0105, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0106, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0107, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0108, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x0109, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x010a, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x010b, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x010c, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x010d, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	configure_environment(0x010e, AIENVCMD_ROOM_SETAMBIENT, TRUE)
	set_ailist(CHR_SELF, GAILIST_IDLE)
	endlist
};

u8 func0432_init_biotech1[] = {
	set_self_chrflag(CHRCFLAG_INVINCIBLE)
	set_self_chrflag(CHRCFLAG_UNEXPLODABLE)
	set_ailist(CHR_SELF, AILIST_BIOTECH1)
	endlist
};

u8 func0433_init_biotech2[] = {
	set_self_chrflag(CHRCFLAG_INVINCIBLE)
	set_self_chrflag(CHRCFLAG_UNEXPLODABLE)
	set_ailist(CHR_SELF, AILIST_BIOTECH2)
	endlist
};

u8 func0430_biotech2[] = {
	label(0x0b)
		call_rng
		if_rand_gt(85, /*goto*/ LABEL_62)
		if_rand_gt(170, /*goto*/ LABEL_63)

		chr_do_animation(ANIM_OPERATE_0221, 0, -1, CHRANIMFLAG_SLOWUPDATE, 0, CHR_SELF, 2)
		goto_next(0x04)

		label(LABEL_62)
		chr_do_animation(ANIM_OPERATE_0222, 0, -1, CHRANIMFLAG_SLOWUPDATE, 0, CHR_SELF, 2)
		goto_next(0x04)

		label(LABEL_63)
		chr_do_animation(ANIM_OPERATE_0223, 0, -1, CHRANIMFLAG_SLOWUPDATE, 0, CHR_SELF, 2)
		goto_next(0x04)

		beginloop(0x04)
			if_chr_stopped(/*goto*/ LABEL_2D)
		endloop(0x04)

		label(LABEL_2D)
	goto_first(0x0b)

	endlist
};

u8 func0431_biotech1[] = {
	label(0x0b)
		call_rng
		if_rand_gt(85, /*goto*/ LABEL_62)
		if_rand_gt(170, /*goto*/ LABEL_63)

		chr_do_animation(ANIM_OPERATE_0204, 0, -1, CHRANIMFLAG_SLOWUPDATE, 0, CHR_SELF, 2)
		goto_next(0x04)

		label(LABEL_62)
		chr_do_animation(ANIM_OPERATE_0205, 0, -1, CHRANIMFLAG_SLOWUPDATE, 0, CHR_SELF, 2)
		goto_next(0x04)

		label(LABEL_63)
		chr_do_animation(ANIM_OPERATE_0206, 0, -1, CHRANIMFLAG_SLOWUPDATE, 0, CHR_SELF, 2)
		goto_next(0x04)

		beginloop(0x04)
			if_chr_stopped(/*goto*/ LABEL_2D)
		endloop(0x04)

		label(LABEL_2D)
	goto_first(0x0b)

	endlist
};

u8 func1036_check_door_terminal_destroyed[] = {
	if_difficulty_lt(DIFF_PA, /*goto*/ LABEL_2E)

	beginloop(0x0b)
		if_object_in_good_condition(OBJ_DOOR_TERMINAL, /*goto*/ LABEL_2D)
		if_stage_flag_eq(STAGEFLAG_DOOR_VIRUS_DOWNLOADED, TRUE, /*goto*/ LABEL_2E)
		show_hudmsg(CHR_BOND, L_LIP_068) // "Mission critical equipment destroyed."
		set_stage_flag(STAGEFLAG_UPLINK_TERMINAL_DESTROYED)
		label(LABEL_2E)
		set_ailist(CHR_SELF, GAILIST_IDLE)

		label(LABEL_2D)
	endloop(0x0b)

	endlist
};

struct ailist ailists[] = {
	{ func1400_give_datauplinks,               0x1400 },
	{ func1001_objectives_failed_msg,          0x1001 },
	{ func1002_intro,                          0x1002 },
	{ func1003_uplink_doors,                   0x1003 },
	{ func1004_uplink_lights,                  0x1004 },
	{ func1005_uplink_autoguns,                0x1005 },
	{ func1006_check_lab_accessed,             0x1006 },
	{ func1007_check_disguise_collected,       0x1007 },
	{ func1009_disguise_timer,                 0x1009 },
	{ func100a_random_doors,                   0x100a },
	{ func100b_check_doorman_dead,             0x100b },
	{ func100c_keycardguy_lights,              0x100c },
	{ func100d_check_entered_lab,              0x100d },
	{ func100e_elvis_timer,                    0x100e },
	{ func100f_check_end_level,                0x100f },
	{ func1010_give_keycard,                   0x1010 },
	{ func1011_unhide_warehouse_spawner,       0x1011 },
	{ func1013_check_chamber_switch_destroyed, 0x1013 },
	{ func1014_check_crate_destroyed,          0x1014 },
	{ func1016_check_undisguised,              0x1016 },
	{ func1017_activate_autogun,               0x1017 },
	{ func1018_disable_chambers,               0x1018 },
	{ func1019_chamber1,                       0x1019 },
	{ func101a_chamber2,                       0x101a },
	{ func101b_chamber3,                       0x101b },
	{ func101c_chamber4,                       0x101c },
	{ func101d_chamber5,                       0x101d },
	{ func101e_chamber6,                       0x101e },
	{ func101f_chamber7,                       0x101f },
	{ func1020_chamber8,                       0x1020 },
	{ func1021_xray_scanning,                  0x1021 },
	{ func1023_setup_door_locks,               0x1023 },
	{ func1024_noop,                           0x1024 },
	{ func1025_toggle_guards,                  0x1025 },
	{ func1026_check_records_destroyed,        0x1026 },
	{ func1027_check_disguise_worn,            0x1027 },
	{ func1028_toggle_mechanic,                0x1028 },
	{ func1029_msg_showers,                    0x1029 },
	{ func102a_msg_temperaturedropping,        0x102a },
	{ func102b_msg_airrecycled,                0x102b },
	{ func102c_msg_hurry,                      0x102c },
	{ func142d_start_lifts,                    0x142d },
	{ func102f_shuffle_disguise,               0x102f },
	{ func1030_lift_door_sounds,               0x1030 },
	{ func1031_toggle_doorman,                 0x1031 },
	{ func1032_count_last_room_guards,         0x1032 },
	{ func1033_unset_untargetable_flag,        0x1033 },
	{ func1034_setup_rtracker,                 0x1034 },
	{ func1435_setup_environment,              0x1435 },
	{ func1036_check_door_terminal_destroyed,  0x1036 },
	{ func1002_intro,                          0x0c00 },
	{ func0c01_outro,                          0x0c01 },
	{ func0401_start_path00,                   0x0401 },
	{ func0402_start_path01,                   0x0402 },
	{ func0403_start_path02,                   0x0403 },
	{ func0404_start_path03,                   0x0404 },
	{ func0405_start_path04,                   0x0405 },
	{ func0406_start_path05,                   0x0406 },
	{ func0407_start_path06,                   0x0407 },
	{ func0408_start_path07,                   0x0408 },
	{ func0409_start_path08,                   0x0409 },
	{ func040a_start_path09,                   0x040a },
	{ func040b_start_path10,                   0x040b },
	{ func040c_start_path11,                   0x040c },
	{ func040d_start_path12,                   0x040d },
	{ func040e_start_path13,                   0x040e },
	{ func040f_start_path14,                   0x040f },
	{ func0410_labtech_showers_sa_pa,          0x0410 },
	{ func0411_labtech_showers_agent,          0x0411 },
	{ func0412_init_labtech_showers,           0x0412 },
	{ func0413_mechanic,                       0x0413 },
	{ func0414_init_mechanic,                  0x0414 },
	{ func0415_warehouse_spawner,              0x0415 },
	{ func0416_become_unaware,                 0x0416 },
	{ func0429_spawn_while_xraying,            0x0429 },
	{ func042a_init_xray_clone,                0x042a },
	{ func042b_xray_clone,                     0x042b },
	{ func0417_warehouse_clone,                0x0417 },
	{ func0418_doorman,                        0x0418 },
	{ func0419_init_doorman,                   0x0419 },
	{ func041a_labtech_harrysmate,             0x041a },
	{ func041b_labtech_keycardguy,             0x041b },
	{ func041c_unused_041c,                    0x041c },
	{ func041d_unused_041d,                    0x041d },
	{ func041e_unused_041e,                    0x041e },
	{ func041f_labtech_lights,                 0x041f },
	{ func0420_labtech_doors,                  0x0420 },
	{ func0421_init_labtech_doors,             0x0421 },
	{ func0422_labtech_records,                0x0422 },
	{ func0423_init_labtech_records,           0x0423 },
	{ func0424_alien,                          0x0424 },
	{ func0425_hiddenguy,                      0x0425 },
	{ func0426_check_looking_at_alien,         0x0426 },
	{ func0427_shock_clone,                    0x0427 },
	{ func0c01_outro,                          0x0428 },
	{ func042c_dragon_guard,                   0x042c },
	{ func042d_superdragon_guard,              0x042d },
	{ func042e_biotech_guard,                  0x042e },
	{ func042e_biotech_guard_alerted,          0x042f },
	{ func0432_init_biotech1,                  0x0432 },
	{ func0433_init_biotech2,                  0x0433 },
	{ func0430_biotech2,                       0x0430 },
	{ func0431_biotech1,                       0x0431 },
	{ NULL, 0 },
};

struct path paths[] = {
	{ path00, 0,  0 },
	{ path01, 1,  0 },
	{ path02, 2,  0 },
	{ path03, 3,  0 },
	{ path04, 4,  0 },
	{ path05, 5,  0 },
	{ path06, 6,  0 },
	{ path07, 7,  0 },
	{ path08, 8,  0 },
	{ path09, 9,  0 },
	{ path10, 10, 0 },
	{ path11, 11, 0 },
	{ path12, 12, 0 },
	{ path13, 13, 0 },
	{ path14, 14, 0 },
	{ NULL,   0,  0 },
};
